@fluidframework/tree 2.81.0-374083 → 2.81.1

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 (1522) hide show
  1. package/CHANGELOG.md +57 -0
  2. package/api-report/tree.alpha.api.md +0 -1
  3. package/dist/codec/codec.d.ts +2 -2
  4. package/dist/codec/codec.d.ts.map +1 -1
  5. package/dist/codec/codec.js +8 -8
  6. package/dist/codec/codec.js.map +1 -1
  7. package/dist/codec/versioned/codec.d.ts +1 -1
  8. package/dist/codec/versioned/codec.d.ts.map +1 -1
  9. package/dist/codec/versioned/codec.js +12 -12
  10. package/dist/codec/versioned/codec.js.map +1 -1
  11. package/dist/core/change-family/changeFamily.d.ts +1 -4
  12. package/dist/core/change-family/changeFamily.d.ts.map +1 -1
  13. package/dist/core/change-family/changeFamily.js.map +1 -1
  14. package/dist/core/change-family/index.d.ts +1 -1
  15. package/dist/core/change-family/index.d.ts.map +1 -1
  16. package/dist/core/change-family/index.js.map +1 -1
  17. package/dist/core/index.d.ts +3 -3
  18. package/dist/core/index.d.ts.map +1 -1
  19. package/dist/core/index.js +4 -6
  20. package/dist/core/index.js.map +1 -1
  21. package/dist/core/rebase/changeRebaser.d.ts +1 -6
  22. package/dist/core/rebase/changeRebaser.d.ts.map +1 -1
  23. package/dist/core/rebase/changeRebaser.js.map +1 -1
  24. package/dist/core/rebase/index.d.ts +1 -1
  25. package/dist/core/rebase/index.d.ts.map +1 -1
  26. package/dist/core/rebase/index.js +1 -2
  27. package/dist/core/rebase/index.js.map +1 -1
  28. package/dist/core/rebase/types.d.ts +1 -2
  29. package/dist/core/rebase/types.d.ts.map +1 -1
  30. package/dist/core/rebase/types.js +1 -5
  31. package/dist/core/rebase/types.js.map +1 -1
  32. package/dist/core/rebase/utils.d.ts.map +1 -1
  33. package/dist/core/rebase/utils.js +7 -25
  34. package/dist/core/rebase/utils.js.map +1 -1
  35. package/dist/core/schema-stored/formatV2.d.ts.map +1 -1
  36. package/dist/core/schema-stored/formatV2.js +4 -4
  37. package/dist/core/schema-stored/formatV2.js.map +1 -1
  38. package/dist/core/tree/anchorSet.d.ts.map +1 -1
  39. package/dist/core/tree/anchorSet.js +1 -1
  40. package/dist/core/tree/anchorSet.js.map +1 -1
  41. package/dist/core/tree/detachedFieldIndex.d.ts +0 -6
  42. package/dist/core/tree/detachedFieldIndex.d.ts.map +1 -1
  43. package/dist/core/tree/detachedFieldIndex.js +0 -9
  44. package/dist/core/tree/detachedFieldIndex.js.map +1 -1
  45. package/dist/core/tree/detachedFieldIndexCodecCommon.d.ts +1 -1
  46. package/dist/core/tree/detachedFieldIndexCodecCommon.d.ts.map +1 -1
  47. package/dist/core/tree/detachedFieldIndexCodecCommon.js.map +1 -1
  48. package/dist/core/tree/detachedFieldIndexCodecV1.d.ts.map +1 -1
  49. package/dist/core/tree/detachedFieldIndexCodecV1.js +3 -3
  50. package/dist/core/tree/detachedFieldIndexCodecV1.js.map +1 -1
  51. package/dist/core/tree/detachedFieldIndexCodecV2.d.ts.map +1 -1
  52. package/dist/core/tree/detachedFieldIndexCodecV2.js +2 -2
  53. package/dist/core/tree/detachedFieldIndexCodecV2.js.map +1 -1
  54. package/dist/core/tree/detachedFieldIndexFormatV1.d.ts.map +1 -1
  55. package/dist/core/tree/detachedFieldIndexFormatV1.js +3 -3
  56. package/dist/core/tree/detachedFieldIndexFormatV1.js.map +1 -1
  57. package/dist/core/tree/detachedFieldIndexFormatV2.d.ts.map +1 -1
  58. package/dist/core/tree/detachedFieldIndexFormatV2.js +4 -4
  59. package/dist/core/tree/detachedFieldIndexFormatV2.js.map +1 -1
  60. package/dist/core/tree/index.d.ts +1 -1
  61. package/dist/core/tree/index.d.ts.map +1 -1
  62. package/dist/core/tree/index.js +3 -4
  63. package/dist/core/tree/index.js.map +1 -1
  64. package/dist/core/tree/pathTree.d.ts +3 -11
  65. package/dist/core/tree/pathTree.d.ts.map +1 -1
  66. package/dist/core/tree/pathTree.js +2 -14
  67. package/dist/core/tree/pathTree.js.map +1 -1
  68. package/dist/core/tree/visitDelta.d.ts +1 -1
  69. package/dist/core/tree/visitDelta.d.ts.map +1 -1
  70. package/dist/core/tree/visitDelta.js.map +1 -1
  71. package/dist/core/tree/visitorUtils.d.ts.map +1 -1
  72. package/dist/core/tree/visitorUtils.js +1 -1
  73. package/dist/core/tree/visitorUtils.js.map +1 -1
  74. package/dist/feature-libraries/changeAtomIdBTree.d.ts +3 -4
  75. package/dist/feature-libraries/changeAtomIdBTree.d.ts.map +1 -1
  76. package/dist/feature-libraries/changeAtomIdBTree.js +2 -16
  77. package/dist/feature-libraries/changeAtomIdBTree.js.map +1 -1
  78. package/dist/feature-libraries/chunked-forest/basicChunk.d.ts.map +1 -1
  79. package/dist/feature-libraries/chunked-forest/basicChunk.js +0 -7
  80. package/dist/feature-libraries/chunked-forest/basicChunk.js.map +1 -1
  81. package/dist/feature-libraries/chunked-forest/chunkTree.d.ts +1 -1
  82. package/dist/feature-libraries/chunked-forest/chunkTree.d.ts.map +1 -1
  83. package/dist/feature-libraries/chunked-forest/chunkTree.js +1 -4
  84. package/dist/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
  85. package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts +1 -1
  86. package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts.map +1 -1
  87. package/dist/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
  88. package/dist/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts +1 -1
  89. package/dist/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts.map +1 -1
  90. package/dist/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.js.map +1 -1
  91. package/dist/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.d.ts +1 -1
  92. package/dist/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.d.ts.map +1 -1
  93. package/dist/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.js.map +1 -1
  94. package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts +1 -1
  95. package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
  96. package/dist/feature-libraries/chunked-forest/codec/codecs.js +1 -1
  97. package/dist/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
  98. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.d.ts +1 -1
  99. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.d.ts.map +1 -1
  100. package/dist/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
  101. package/dist/feature-libraries/chunked-forest/codec/format.d.ts.map +1 -1
  102. package/dist/feature-libraries/chunked-forest/codec/format.js +1 -1
  103. package/dist/feature-libraries/chunked-forest/codec/format.js.map +1 -1
  104. package/dist/feature-libraries/chunked-forest/codec/formatGeneric.d.ts.map +1 -1
  105. package/dist/feature-libraries/chunked-forest/codec/formatGeneric.js.map +1 -1
  106. package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.d.ts +1 -1
  107. package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.d.ts.map +1 -1
  108. package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.js +2 -2
  109. package/dist/feature-libraries/chunked-forest/codec/schemaBasedEncode.js.map +1 -1
  110. package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts +44 -93
  111. package/dist/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
  112. package/dist/feature-libraries/default-schema/defaultEditBuilder.js +78 -245
  113. package/dist/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
  114. package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts +11 -53
  115. package/dist/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
  116. package/dist/feature-libraries/default-schema/defaultFieldKinds.js +25 -75
  117. package/dist/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
  118. package/dist/feature-libraries/default-schema/index.d.ts +2 -3
  119. package/dist/feature-libraries/default-schema/index.d.ts.map +1 -1
  120. package/dist/feature-libraries/default-schema/index.js +2 -5
  121. package/dist/feature-libraries/default-schema/index.js.map +1 -1
  122. package/dist/feature-libraries/default-schema/mappedEditBuilder.d.ts +6 -7
  123. package/dist/feature-libraries/default-schema/mappedEditBuilder.d.ts.map +1 -1
  124. package/dist/feature-libraries/default-schema/mappedEditBuilder.js +0 -15
  125. package/dist/feature-libraries/default-schema/mappedEditBuilder.js.map +1 -1
  126. package/dist/feature-libraries/deltaUtils.d.ts +0 -1
  127. package/dist/feature-libraries/deltaUtils.d.ts.map +1 -1
  128. package/dist/feature-libraries/deltaUtils.js +1 -6
  129. package/dist/feature-libraries/deltaUtils.js.map +1 -1
  130. package/dist/feature-libraries/fieldKindIdentifiers.d.ts +9 -0
  131. package/dist/feature-libraries/fieldKindIdentifiers.d.ts.map +1 -0
  132. package/dist/feature-libraries/fieldKindIdentifiers.js +16 -0
  133. package/dist/feature-libraries/fieldKindIdentifiers.js.map +1 -0
  134. package/dist/feature-libraries/flex-tree/context.d.ts +0 -9
  135. package/dist/feature-libraries/flex-tree/context.d.ts.map +1 -1
  136. package/dist/feature-libraries/flex-tree/context.js +0 -6
  137. package/dist/feature-libraries/flex-tree/context.js.map +1 -1
  138. package/dist/feature-libraries/flex-tree/flexTreeTypes.d.ts +6 -6
  139. package/dist/feature-libraries/flex-tree/flexTreeTypes.d.ts.map +1 -1
  140. package/dist/feature-libraries/flex-tree/flexTreeTypes.js.map +1 -1
  141. package/dist/feature-libraries/flex-tree/lazyField.d.ts +7 -8
  142. package/dist/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
  143. package/dist/feature-libraries/flex-tree/lazyField.js +17 -48
  144. package/dist/feature-libraries/flex-tree/lazyField.js.map +1 -1
  145. package/dist/feature-libraries/flex-tree/observer.d.ts +1 -1
  146. package/dist/feature-libraries/flex-tree/observer.d.ts.map +1 -1
  147. package/dist/feature-libraries/flex-tree/observer.js.map +1 -1
  148. package/dist/feature-libraries/forest-summary/codec.d.ts.map +1 -1
  149. package/dist/feature-libraries/forest-summary/codec.js +1 -1
  150. package/dist/feature-libraries/forest-summary/codec.js.map +1 -1
  151. package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
  152. package/dist/feature-libraries/forest-summary/forestSummarizer.js +3 -3
  153. package/dist/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
  154. package/dist/feature-libraries/forest-summary/formatV1.d.ts.map +1 -1
  155. package/dist/feature-libraries/forest-summary/formatV1.js.map +1 -1
  156. package/dist/feature-libraries/forest-summary/formatV2.d.ts.map +1 -1
  157. package/dist/feature-libraries/forest-summary/formatV2.js.map +1 -1
  158. package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts +4 -4
  159. package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts.map +1 -1
  160. package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.js +2 -2
  161. package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.js.map +1 -1
  162. package/dist/feature-libraries/forest-summary/summaryTypes.d.ts.map +1 -1
  163. package/dist/feature-libraries/forest-summary/summaryTypes.js.map +1 -1
  164. package/dist/feature-libraries/index.d.ts +3 -3
  165. package/dist/feature-libraries/index.d.ts.map +1 -1
  166. package/dist/feature-libraries/index.js +3 -8
  167. package/dist/feature-libraries/index.js.map +1 -1
  168. package/dist/feature-libraries/mapTreeCursor.d.ts.map +1 -1
  169. package/dist/feature-libraries/mapTreeCursor.js +0 -1
  170. package/dist/feature-libraries/mapTreeCursor.js.map +1 -1
  171. package/dist/feature-libraries/mitigatedChangeFamily.d.ts.map +1 -1
  172. package/dist/feature-libraries/mitigatedChangeFamily.js +2 -2
  173. package/dist/feature-libraries/mitigatedChangeFamily.js.map +1 -1
  174. package/dist/feature-libraries/modular-schema/crossFieldQueries.d.ts +21 -97
  175. package/dist/feature-libraries/modular-schema/crossFieldQueries.d.ts.map +1 -1
  176. package/dist/feature-libraries/modular-schema/crossFieldQueries.js +7 -4
  177. package/dist/feature-libraries/modular-schema/crossFieldQueries.js.map +1 -1
  178. package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts +51 -20
  179. package/dist/feature-libraries/modular-schema/fieldChangeHandler.d.ts.map +1 -1
  180. package/dist/feature-libraries/modular-schema/fieldChangeHandler.js.map +1 -1
  181. package/dist/feature-libraries/modular-schema/fieldKindConfiguration.d.ts.map +1 -1
  182. package/dist/feature-libraries/modular-schema/fieldKindConfiguration.js.map +1 -1
  183. package/dist/feature-libraries/modular-schema/genericFieldKind.d.ts +1 -1
  184. package/dist/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
  185. package/dist/feature-libraries/modular-schema/genericFieldKind.js +11 -5
  186. package/dist/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
  187. package/dist/feature-libraries/modular-schema/index.d.ts +4 -4
  188. package/dist/feature-libraries/modular-schema/index.d.ts.map +1 -1
  189. package/dist/feature-libraries/modular-schema/index.js +2 -2
  190. package/dist/feature-libraries/modular-schema/index.js.map +1 -1
  191. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.d.ts +28 -11
  192. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.d.ts.map +1 -1
  193. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.js +162 -254
  194. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.js.map +1 -1
  195. package/dist/feature-libraries/modular-schema/modularChangeCodecV2.d.ts.map +1 -1
  196. package/dist/feature-libraries/modular-schema/modularChangeCodecV2.js +1 -1
  197. package/dist/feature-libraries/modular-schema/modularChangeCodecV2.js.map +1 -1
  198. package/dist/feature-libraries/modular-schema/modularChangeCodecs.d.ts.map +1 -1
  199. package/dist/feature-libraries/modular-schema/modularChangeCodecs.js +1 -8
  200. package/dist/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
  201. package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts +21 -49
  202. package/dist/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
  203. package/dist/feature-libraries/modular-schema/modularChangeFamily.js +460 -1325
  204. package/dist/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
  205. package/dist/feature-libraries/modular-schema/modularChangeFormatV1.d.ts.map +1 -1
  206. package/dist/feature-libraries/modular-schema/modularChangeFormatV1.js.map +1 -1
  207. package/dist/feature-libraries/modular-schema/modularChangeTypes.d.ts +8 -44
  208. package/dist/feature-libraries/modular-schema/modularChangeTypes.d.ts.map +1 -1
  209. package/dist/feature-libraries/modular-schema/modularChangeTypes.js +3 -3
  210. package/dist/feature-libraries/modular-schema/modularChangeTypes.js.map +1 -1
  211. package/dist/feature-libraries/object-forest/objectForest.d.ts.map +1 -1
  212. package/dist/feature-libraries/object-forest/objectForest.js +2 -2
  213. package/dist/feature-libraries/object-forest/objectForest.js.map +1 -1
  214. package/dist/feature-libraries/optional-field/index.d.ts +2 -2
  215. package/dist/feature-libraries/optional-field/index.d.ts.map +1 -1
  216. package/dist/feature-libraries/optional-field/index.js +4 -7
  217. package/dist/feature-libraries/optional-field/index.js.map +1 -1
  218. package/dist/feature-libraries/optional-field/optionalField.d.ts +34 -5
  219. package/dist/feature-libraries/optional-field/optionalField.d.ts.map +1 -1
  220. package/dist/feature-libraries/optional-field/optionalField.js +455 -221
  221. package/dist/feature-libraries/optional-field/optionalField.js.map +1 -1
  222. package/dist/feature-libraries/optional-field/optionalFieldChangeTypes.d.ts +33 -24
  223. package/dist/feature-libraries/optional-field/optionalFieldChangeTypes.d.ts.map +1 -1
  224. package/dist/feature-libraries/optional-field/optionalFieldChangeTypes.js.map +1 -1
  225. package/dist/feature-libraries/optional-field/optionalFieldCodecV2.d.ts +1 -1
  226. package/dist/feature-libraries/optional-field/optionalFieldCodecV2.d.ts.map +1 -1
  227. package/dist/feature-libraries/optional-field/optionalFieldCodecV2.js +28 -57
  228. package/dist/feature-libraries/optional-field/optionalFieldCodecV2.js.map +1 -1
  229. package/dist/feature-libraries/optional-field/optionalFieldCodecs.d.ts.map +1 -1
  230. package/dist/feature-libraries/optional-field/optionalFieldCodecs.js +1 -5
  231. package/dist/feature-libraries/optional-field/optionalFieldCodecs.js.map +1 -1
  232. package/dist/feature-libraries/optional-field/requiredField.d.ts +36 -0
  233. package/dist/feature-libraries/optional-field/requiredField.d.ts.map +1 -0
  234. package/dist/feature-libraries/optional-field/requiredField.js +27 -0
  235. package/dist/feature-libraries/optional-field/requiredField.js.map +1 -0
  236. package/dist/feature-libraries/schema-edits/schemaChangeCodecs.d.ts +1 -1
  237. package/dist/feature-libraries/schema-edits/schemaChangeCodecs.d.ts.map +1 -1
  238. package/dist/feature-libraries/schema-edits/schemaChangeCodecs.js +7 -7
  239. package/dist/feature-libraries/schema-edits/schemaChangeCodecs.js.map +1 -1
  240. package/dist/feature-libraries/schema-edits/schemaChangeFormat.d.ts.map +1 -1
  241. package/dist/feature-libraries/schema-edits/schemaChangeFormat.js.map +1 -1
  242. package/dist/feature-libraries/schemaChecker.d.ts.map +1 -1
  243. package/dist/feature-libraries/schemaChecker.js +1 -1
  244. package/dist/feature-libraries/schemaChecker.js.map +1 -1
  245. package/dist/feature-libraries/sequence-field/compose.d.ts +7 -6
  246. package/dist/feature-libraries/sequence-field/compose.d.ts.map +1 -1
  247. package/dist/feature-libraries/sequence-field/compose.js +259 -83
  248. package/dist/feature-libraries/sequence-field/compose.js.map +1 -1
  249. package/dist/feature-libraries/sequence-field/helperTypes.d.ts +10 -14
  250. package/dist/feature-libraries/sequence-field/helperTypes.d.ts.map +1 -1
  251. package/dist/feature-libraries/sequence-field/helperTypes.js.map +1 -1
  252. package/dist/feature-libraries/sequence-field/index.d.ts +2 -13
  253. package/dist/feature-libraries/sequence-field/index.d.ts.map +1 -1
  254. package/dist/feature-libraries/sequence-field/index.js +3 -28
  255. package/dist/feature-libraries/sequence-field/index.js.map +1 -1
  256. package/dist/feature-libraries/sequence-field/invert.d.ts +3 -3
  257. package/dist/feature-libraries/sequence-field/invert.d.ts.map +1 -1
  258. package/dist/feature-libraries/sequence-field/invert.js +167 -65
  259. package/dist/feature-libraries/sequence-field/invert.js.map +1 -1
  260. package/dist/feature-libraries/sequence-field/markQueue.d.ts +2 -2
  261. package/dist/feature-libraries/sequence-field/markQueue.d.ts.map +1 -1
  262. package/dist/feature-libraries/sequence-field/markQueue.js.map +1 -1
  263. package/dist/feature-libraries/sequence-field/moveEffectTable.d.ts +56 -4
  264. package/dist/feature-libraries/sequence-field/moveEffectTable.d.ts.map +1 -1
  265. package/dist/feature-libraries/sequence-field/moveEffectTable.js +90 -7
  266. package/dist/feature-libraries/sequence-field/moveEffectTable.js.map +1 -1
  267. package/dist/feature-libraries/sequence-field/rebase.d.ts +3 -3
  268. package/dist/feature-libraries/sequence-field/rebase.d.ts.map +1 -1
  269. package/dist/feature-libraries/sequence-field/rebase.js +114 -107
  270. package/dist/feature-libraries/sequence-field/rebase.js.map +1 -1
  271. package/dist/feature-libraries/sequence-field/relevantRemovedRoots.d.ts +9 -0
  272. package/dist/feature-libraries/sequence-field/relevantRemovedRoots.d.ts.map +1 -0
  273. package/dist/feature-libraries/sequence-field/relevantRemovedRoots.js +50 -0
  274. package/dist/feature-libraries/sequence-field/relevantRemovedRoots.js.map +1 -0
  275. package/dist/feature-libraries/sequence-field/replaceRevisions.d.ts.map +1 -1
  276. package/dist/feature-libraries/sequence-field/replaceRevisions.js +31 -18
  277. package/dist/feature-libraries/sequence-field/replaceRevisions.js.map +1 -1
  278. package/dist/feature-libraries/sequence-field/sequenceFieldChangeHandler.d.ts.map +1 -1
  279. package/dist/feature-libraries/sequence-field/sequenceFieldChangeHandler.js +2 -0
  280. package/dist/feature-libraries/sequence-field/sequenceFieldChangeHandler.js.map +1 -1
  281. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts +4 -22
  282. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts.map +1 -1
  283. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.js +187 -365
  284. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV2.js.map +1 -1
  285. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts.map +1 -1
  286. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.js +62 -20
  287. package/dist/feature-libraries/sequence-field/sequenceFieldCodecV3.js.map +1 -1
  288. package/dist/feature-libraries/sequence-field/sequenceFieldEditor.d.ts +2 -2
  289. package/dist/feature-libraries/sequence-field/sequenceFieldEditor.d.ts.map +1 -1
  290. package/dist/feature-libraries/sequence-field/sequenceFieldEditor.js +10 -10
  291. package/dist/feature-libraries/sequence-field/sequenceFieldEditor.js.map +1 -1
  292. package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.d.ts +2 -3
  293. package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.d.ts.map +1 -1
  294. package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.js +109 -14
  295. package/dist/feature-libraries/sequence-field/sequenceFieldToDelta.js.map +1 -1
  296. package/dist/feature-libraries/sequence-field/sequenceKind.d.ts +16 -0
  297. package/dist/feature-libraries/sequence-field/sequenceKind.d.ts.map +1 -0
  298. package/dist/feature-libraries/sequence-field/sequenceKind.js +24 -0
  299. package/dist/feature-libraries/sequence-field/sequenceKind.js.map +1 -0
  300. package/dist/feature-libraries/sequence-field/types.d.ts +59 -30
  301. package/dist/feature-libraries/sequence-field/types.d.ts.map +1 -1
  302. package/dist/feature-libraries/sequence-field/types.js.map +1 -1
  303. package/dist/feature-libraries/sequence-field/utils.d.ts +24 -15
  304. package/dist/feature-libraries/sequence-field/utils.d.ts.map +1 -1
  305. package/dist/feature-libraries/sequence-field/utils.js +305 -116
  306. package/dist/feature-libraries/sequence-field/utils.js.map +1 -1
  307. package/dist/index.d.ts +1 -1
  308. package/dist/index.d.ts.map +1 -1
  309. package/dist/index.js +2 -1
  310. package/dist/index.js.map +1 -1
  311. package/dist/packageVersion.d.ts +1 -1
  312. package/dist/packageVersion.d.ts.map +1 -1
  313. package/dist/packageVersion.js +1 -1
  314. package/dist/packageVersion.js.map +1 -1
  315. package/dist/shared-tree/independentView.d.ts.map +1 -1
  316. package/dist/shared-tree/independentView.js +7 -7
  317. package/dist/shared-tree/independentView.js.map +1 -1
  318. package/dist/shared-tree/index.d.ts +1 -1
  319. package/dist/shared-tree/index.d.ts.map +1 -1
  320. package/dist/shared-tree/index.js.map +1 -1
  321. package/dist/shared-tree/schematizeTree.d.ts +4 -4
  322. package/dist/shared-tree/schematizeTree.d.ts.map +1 -1
  323. package/dist/shared-tree/schematizeTree.js +1 -2
  324. package/dist/shared-tree/schematizeTree.js.map +1 -1
  325. package/dist/shared-tree/schematizingTreeView.d.ts +5 -1
  326. package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
  327. package/dist/shared-tree/schematizingTreeView.js +39 -40
  328. package/dist/shared-tree/schematizingTreeView.js.map +1 -1
  329. package/dist/shared-tree/sharedTree.d.ts +5 -11
  330. package/dist/shared-tree/sharedTree.d.ts.map +1 -1
  331. package/dist/shared-tree/sharedTree.js +5 -43
  332. package/dist/shared-tree/sharedTree.js.map +1 -1
  333. package/dist/shared-tree/sharedTreeChangeCodecs.d.ts +1 -1
  334. package/dist/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
  335. package/dist/shared-tree/sharedTreeChangeCodecs.js +0 -1
  336. package/dist/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
  337. package/dist/shared-tree/sharedTreeChangeEnricher.d.ts +31 -24
  338. package/dist/shared-tree/sharedTreeChangeEnricher.d.ts.map +1 -1
  339. package/dist/shared-tree/sharedTreeChangeEnricher.js +75 -58
  340. package/dist/shared-tree/sharedTreeChangeEnricher.js.map +1 -1
  341. package/dist/shared-tree/sharedTreeChangeFamily.d.ts +5 -5
  342. package/dist/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
  343. package/dist/shared-tree/sharedTreeChangeFamily.js +4 -10
  344. package/dist/shared-tree/sharedTreeChangeFamily.js.map +1 -1
  345. package/dist/shared-tree/sharedTreeEditBuilder.d.ts +6 -16
  346. package/dist/shared-tree/sharedTreeEditBuilder.d.ts.map +1 -1
  347. package/dist/shared-tree/sharedTreeEditBuilder.js +7 -14
  348. package/dist/shared-tree/sharedTreeEditBuilder.js.map +1 -1
  349. package/dist/shared-tree/tree.d.ts.map +1 -1
  350. package/dist/shared-tree/tree.js +14 -14
  351. package/dist/shared-tree/tree.js.map +1 -1
  352. package/dist/shared-tree/treeAlpha.d.ts +1 -1
  353. package/dist/shared-tree/treeAlpha.d.ts.map +1 -1
  354. package/dist/shared-tree/treeAlpha.js +77 -77
  355. package/dist/shared-tree/treeAlpha.js.map +1 -1
  356. package/dist/shared-tree/treeCheckout.d.ts +29 -13
  357. package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
  358. package/dist/shared-tree/treeCheckout.js +80 -79
  359. package/dist/shared-tree/treeCheckout.js.map +1 -1
  360. package/dist/shared-tree-core/branch.d.ts +3 -4
  361. package/dist/shared-tree-core/branch.d.ts.map +1 -1
  362. package/dist/shared-tree-core/branch.js +3 -4
  363. package/dist/shared-tree-core/branch.js.map +1 -1
  364. package/dist/shared-tree-core/branchCommitEnricher.d.ts +18 -31
  365. package/dist/shared-tree-core/branchCommitEnricher.d.ts.map +1 -1
  366. package/dist/shared-tree-core/branchCommitEnricher.js +24 -76
  367. package/dist/shared-tree-core/branchCommitEnricher.js.map +1 -1
  368. package/dist/shared-tree-core/branchIdCodec.d.ts.map +1 -1
  369. package/dist/shared-tree-core/branchIdCodec.js.map +1 -1
  370. package/dist/shared-tree-core/changeEnricher.d.ts +8 -43
  371. package/dist/shared-tree-core/changeEnricher.d.ts.map +1 -1
  372. package/dist/shared-tree-core/changeEnricher.js +0 -13
  373. package/dist/shared-tree-core/changeEnricher.js.map +1 -1
  374. package/dist/shared-tree-core/defaultResubmitMachine.d.ts +4 -12
  375. package/dist/shared-tree-core/defaultResubmitMachine.d.ts.map +1 -1
  376. package/dist/shared-tree-core/defaultResubmitMachine.js +26 -36
  377. package/dist/shared-tree-core/defaultResubmitMachine.js.map +1 -1
  378. package/dist/shared-tree-core/editManager.d.ts +3 -3
  379. package/dist/shared-tree-core/editManager.d.ts.map +1 -1
  380. package/dist/shared-tree-core/editManager.js +11 -11
  381. package/dist/shared-tree-core/editManager.js.map +1 -1
  382. package/dist/shared-tree-core/editManagerCodecs.d.ts +1 -5
  383. package/dist/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
  384. package/dist/shared-tree-core/editManagerCodecs.js +2 -10
  385. package/dist/shared-tree-core/editManagerCodecs.js.map +1 -1
  386. package/dist/shared-tree-core/editManagerCodecsCommons.d.ts +1 -1
  387. package/dist/shared-tree-core/editManagerCodecsCommons.d.ts.map +1 -1
  388. package/dist/shared-tree-core/editManagerCodecsCommons.js +1 -2
  389. package/dist/shared-tree-core/editManagerCodecsCommons.js.map +1 -1
  390. package/dist/shared-tree-core/editManagerCodecsV1toV4.d.ts.map +1 -1
  391. package/dist/shared-tree-core/editManagerCodecsV1toV4.js +1 -1
  392. package/dist/shared-tree-core/editManagerCodecsV1toV4.js.map +1 -1
  393. package/dist/shared-tree-core/editManagerCodecsVSharedBranches.d.ts.map +1 -1
  394. package/dist/shared-tree-core/editManagerCodecsVSharedBranches.js +1 -1
  395. package/dist/shared-tree-core/editManagerCodecsVSharedBranches.js.map +1 -1
  396. package/dist/shared-tree-core/editManagerFormatCommons.d.ts +0 -1
  397. package/dist/shared-tree-core/editManagerFormatCommons.d.ts.map +1 -1
  398. package/dist/shared-tree-core/editManagerFormatCommons.js +0 -6
  399. package/dist/shared-tree-core/editManagerFormatCommons.js.map +1 -1
  400. package/dist/shared-tree-core/editManagerFormatV1toV4.d.ts +2 -2
  401. package/dist/shared-tree-core/editManagerFormatV1toV4.d.ts.map +1 -1
  402. package/dist/shared-tree-core/editManagerFormatV1toV4.js +0 -1
  403. package/dist/shared-tree-core/editManagerFormatV1toV4.js.map +1 -1
  404. package/dist/shared-tree-core/editManagerFormatVSharedBranches.d.ts +1 -1
  405. package/dist/shared-tree-core/editManagerFormatVSharedBranches.d.ts.map +1 -1
  406. package/dist/shared-tree-core/editManagerFormatVSharedBranches.js +1 -1
  407. package/dist/shared-tree-core/editManagerFormatVSharedBranches.js.map +1 -1
  408. package/dist/shared-tree-core/index.d.ts +4 -4
  409. package/dist/shared-tree-core/index.d.ts.map +1 -1
  410. package/dist/shared-tree-core/index.js +1 -5
  411. package/dist/shared-tree-core/index.js.map +1 -1
  412. package/dist/shared-tree-core/messageCodecV1ToV4.d.ts +2 -2
  413. package/dist/shared-tree-core/messageCodecV1ToV4.d.ts.map +1 -1
  414. package/dist/shared-tree-core/messageCodecV1ToV4.js +1 -1
  415. package/dist/shared-tree-core/messageCodecV1ToV4.js.map +1 -1
  416. package/dist/shared-tree-core/messageCodecVSharedBranches.d.ts +1 -1
  417. package/dist/shared-tree-core/messageCodecVSharedBranches.d.ts.map +1 -1
  418. package/dist/shared-tree-core/messageCodecVSharedBranches.js +2 -2
  419. package/dist/shared-tree-core/messageCodecVSharedBranches.js.map +1 -1
  420. package/dist/shared-tree-core/messageCodecs.d.ts +2 -6
  421. package/dist/shared-tree-core/messageCodecs.d.ts.map +1 -1
  422. package/dist/shared-tree-core/messageCodecs.js +2 -10
  423. package/dist/shared-tree-core/messageCodecs.js.map +1 -1
  424. package/dist/shared-tree-core/messageFormat.d.ts +0 -1
  425. package/dist/shared-tree-core/messageFormat.d.ts.map +1 -1
  426. package/dist/shared-tree-core/messageFormat.js +0 -6
  427. package/dist/shared-tree-core/messageFormat.js.map +1 -1
  428. package/dist/shared-tree-core/messageFormatV1ToV4.d.ts +2 -2
  429. package/dist/shared-tree-core/messageFormatV1ToV4.d.ts.map +1 -1
  430. package/dist/shared-tree-core/messageFormatV1ToV4.js +0 -1
  431. package/dist/shared-tree-core/messageFormatV1ToV4.js.map +1 -1
  432. package/dist/shared-tree-core/messageFormatVSharedBranches.d.ts.map +1 -1
  433. package/dist/shared-tree-core/messageFormatVSharedBranches.js.map +1 -1
  434. package/dist/shared-tree-core/messageTypes.d.ts.map +1 -1
  435. package/dist/shared-tree-core/messageTypes.js.map +1 -1
  436. package/dist/shared-tree-core/sharedTreeCore.d.ts +8 -5
  437. package/dist/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
  438. package/dist/shared-tree-core/sharedTreeCore.js +14 -14
  439. package/dist/shared-tree-core/sharedTreeCore.js.map +1 -1
  440. package/dist/shared-tree-core/versionedSummarizer.d.ts.map +1 -1
  441. package/dist/shared-tree-core/versionedSummarizer.js +1 -1
  442. package/dist/shared-tree-core/versionedSummarizer.js.map +1 -1
  443. package/dist/simple-tree/api/configuration.d.ts +2 -2
  444. package/dist/simple-tree/api/configuration.d.ts.map +1 -1
  445. package/dist/simple-tree/api/configuration.js +14 -14
  446. package/dist/simple-tree/api/configuration.js.map +1 -1
  447. package/dist/simple-tree/api/create.d.ts +1 -1
  448. package/dist/simple-tree/api/create.d.ts.map +1 -1
  449. package/dist/simple-tree/api/create.js +7 -7
  450. package/dist/simple-tree/api/create.js.map +1 -1
  451. package/dist/simple-tree/api/dirtyIndex.d.ts +1 -1
  452. package/dist/simple-tree/api/dirtyIndex.d.ts.map +1 -1
  453. package/dist/simple-tree/api/dirtyIndex.js.map +1 -1
  454. package/dist/simple-tree/api/discrepancies.d.ts.map +1 -1
  455. package/dist/simple-tree/api/discrepancies.js +23 -23
  456. package/dist/simple-tree/api/discrepancies.js.map +1 -1
  457. package/dist/simple-tree/api/getJsonSchema.d.ts +1 -1
  458. package/dist/simple-tree/api/getJsonSchema.d.ts.map +1 -1
  459. package/dist/simple-tree/api/getJsonSchema.js +1 -1
  460. package/dist/simple-tree/api/getJsonSchema.js.map +1 -1
  461. package/dist/simple-tree/api/identifierIndex.d.ts +2 -2
  462. package/dist/simple-tree/api/identifierIndex.d.ts.map +1 -1
  463. package/dist/simple-tree/api/identifierIndex.js.map +1 -1
  464. package/dist/simple-tree/api/incrementalAllowedTypes.d.ts +1 -1
  465. package/dist/simple-tree/api/incrementalAllowedTypes.d.ts.map +1 -1
  466. package/dist/simple-tree/api/incrementalAllowedTypes.js +6 -6
  467. package/dist/simple-tree/api/incrementalAllowedTypes.js.map +1 -1
  468. package/dist/simple-tree/api/schemaCompatibilityTester.d.ts +1 -1
  469. package/dist/simple-tree/api/schemaCompatibilityTester.d.ts.map +1 -1
  470. package/dist/simple-tree/api/schemaCompatibilityTester.js +1 -1
  471. package/dist/simple-tree/api/schemaCompatibilityTester.js.map +1 -1
  472. package/dist/simple-tree/api/schemaCreationUtilities.d.ts +2 -2
  473. package/dist/simple-tree/api/schemaCreationUtilities.d.ts.map +1 -1
  474. package/dist/simple-tree/api/schemaCreationUtilities.js +7 -7
  475. package/dist/simple-tree/api/schemaCreationUtilities.js.map +1 -1
  476. package/dist/simple-tree/api/schemaFactory.d.ts +2 -2
  477. package/dist/simple-tree/api/schemaFactory.d.ts.map +1 -1
  478. package/dist/simple-tree/api/schemaFactory.js +7 -7
  479. package/dist/simple-tree/api/schemaFactory.js.map +1 -1
  480. package/dist/simple-tree/api/schemaFactoryAlpha.d.ts +6 -6
  481. package/dist/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
  482. package/dist/simple-tree/api/schemaFactoryAlpha.js +1 -1
  483. package/dist/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
  484. package/dist/simple-tree/api/schemaFactoryBeta.d.ts +2 -2
  485. package/dist/simple-tree/api/schemaFactoryBeta.d.ts.map +1 -1
  486. package/dist/simple-tree/api/schemaFactoryBeta.js +1 -0
  487. package/dist/simple-tree/api/schemaFactoryBeta.js.map +1 -1
  488. package/dist/simple-tree/api/schemaFactoryRecursive.d.ts +1 -1
  489. package/dist/simple-tree/api/schemaFactoryRecursive.d.ts.map +1 -1
  490. package/dist/simple-tree/api/schemaFactoryRecursive.js.map +1 -1
  491. package/dist/simple-tree/api/schemaFromSimple.d.ts.map +1 -1
  492. package/dist/simple-tree/api/schemaFromSimple.js.map +1 -1
  493. package/dist/simple-tree/api/schemaStatics.d.ts.map +1 -1
  494. package/dist/simple-tree/api/schemaStatics.js.map +1 -1
  495. package/dist/simple-tree/api/simpleSchemaCodec.d.ts +1 -1
  496. package/dist/simple-tree/api/simpleSchemaCodec.d.ts.map +1 -1
  497. package/dist/simple-tree/api/simpleSchemaCodec.js +17 -17
  498. package/dist/simple-tree/api/simpleSchemaCodec.js.map +1 -1
  499. package/dist/simple-tree/api/simpleSchemaToJsonSchema.d.ts +2 -2
  500. package/dist/simple-tree/api/simpleSchemaToJsonSchema.d.ts.map +1 -1
  501. package/dist/simple-tree/api/simpleSchemaToJsonSchema.js +2 -2
  502. package/dist/simple-tree/api/simpleSchemaToJsonSchema.js.map +1 -1
  503. package/dist/simple-tree/api/simpleTreeIndex.d.ts +1 -1
  504. package/dist/simple-tree/api/simpleTreeIndex.d.ts.map +1 -1
  505. package/dist/simple-tree/api/simpleTreeIndex.js +1 -1
  506. package/dist/simple-tree/api/simpleTreeIndex.js.map +1 -1
  507. package/dist/simple-tree/api/snapshotCompatibilityChecker.d.ts.map +1 -1
  508. package/dist/simple-tree/api/snapshotCompatibilityChecker.js +14 -14
  509. package/dist/simple-tree/api/snapshotCompatibilityChecker.js.map +1 -1
  510. package/dist/simple-tree/api/storedSchema.d.ts.map +1 -1
  511. package/dist/simple-tree/api/storedSchema.js.map +1 -1
  512. package/dist/simple-tree/api/tree.d.ts +2 -2
  513. package/dist/simple-tree/api/tree.d.ts.map +1 -1
  514. package/dist/simple-tree/api/tree.js.map +1 -1
  515. package/dist/simple-tree/api/treeBeta.d.ts +1 -1
  516. package/dist/simple-tree/api/treeBeta.d.ts.map +1 -1
  517. package/dist/simple-tree/api/treeBeta.js +2 -2
  518. package/dist/simple-tree/api/treeBeta.js.map +1 -1
  519. package/dist/simple-tree/api/treeNodeApi.d.ts.map +1 -1
  520. package/dist/simple-tree/api/treeNodeApi.js +4 -4
  521. package/dist/simple-tree/api/treeNodeApi.js.map +1 -1
  522. package/dist/simple-tree/api/typesUnsafe.d.ts +1 -1
  523. package/dist/simple-tree/api/typesUnsafe.d.ts.map +1 -1
  524. package/dist/simple-tree/api/typesUnsafe.js.map +1 -1
  525. package/dist/simple-tree/api/verboseTree.d.ts +1 -1
  526. package/dist/simple-tree/api/verboseTree.d.ts.map +1 -1
  527. package/dist/simple-tree/api/verboseTree.js +22 -22
  528. package/dist/simple-tree/api/verboseTree.js.map +1 -1
  529. package/dist/simple-tree/core/allowedTypes.d.ts +1 -1
  530. package/dist/simple-tree/core/allowedTypes.d.ts.map +1 -1
  531. package/dist/simple-tree/core/allowedTypes.js +7 -7
  532. package/dist/simple-tree/core/allowedTypes.js.map +1 -1
  533. package/dist/simple-tree/core/context.d.ts.map +1 -1
  534. package/dist/simple-tree/core/context.js.map +1 -1
  535. package/dist/simple-tree/core/treeNode.d.ts.map +1 -1
  536. package/dist/simple-tree/core/treeNode.js +1 -1
  537. package/dist/simple-tree/core/treeNode.js.map +1 -1
  538. package/dist/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
  539. package/dist/simple-tree/core/treeNodeKernel.js +1 -3
  540. package/dist/simple-tree/core/treeNodeKernel.js.map +1 -1
  541. package/dist/simple-tree/core/treeNodeSchema.d.ts +5 -5
  542. package/dist/simple-tree/core/treeNodeSchema.d.ts.map +1 -1
  543. package/dist/simple-tree/core/treeNodeSchema.js.map +1 -1
  544. package/dist/simple-tree/core/treeNodeValid.d.ts +3 -3
  545. package/dist/simple-tree/core/treeNodeValid.d.ts.map +1 -1
  546. package/dist/simple-tree/core/treeNodeValid.js +2 -2
  547. package/dist/simple-tree/core/treeNodeValid.js.map +1 -1
  548. package/dist/simple-tree/core/unhydratedFlexTree.d.ts +16 -16
  549. package/dist/simple-tree/core/unhydratedFlexTree.d.ts.map +1 -1
  550. package/dist/simple-tree/core/unhydratedFlexTree.js +8 -59
  551. package/dist/simple-tree/core/unhydratedFlexTree.js.map +1 -1
  552. package/dist/simple-tree/core/withType.d.ts.map +1 -1
  553. package/dist/simple-tree/core/withType.js.map +1 -1
  554. package/dist/simple-tree/createContext.d.ts.map +1 -1
  555. package/dist/simple-tree/createContext.js.map +1 -1
  556. package/dist/simple-tree/fieldSchema.d.ts +5 -5
  557. package/dist/simple-tree/fieldSchema.d.ts.map +1 -1
  558. package/dist/simple-tree/fieldSchema.js.map +1 -1
  559. package/dist/simple-tree/index.d.ts +2 -2
  560. package/dist/simple-tree/index.d.ts.map +1 -1
  561. package/dist/simple-tree/index.js +1 -1
  562. package/dist/simple-tree/index.js.map +1 -1
  563. package/dist/simple-tree/leafNodeSchema.d.ts +1 -1
  564. package/dist/simple-tree/leafNodeSchema.d.ts.map +1 -1
  565. package/dist/simple-tree/leafNodeSchema.js +15 -15
  566. package/dist/simple-tree/leafNodeSchema.js.map +1 -1
  567. package/dist/simple-tree/node-kinds/array/arrayNode.d.ts +1 -1
  568. package/dist/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
  569. package/dist/simple-tree/node-kinds/array/arrayNode.js +47 -49
  570. package/dist/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
  571. package/dist/simple-tree/node-kinds/array/arrayNodeTypes.d.ts +1 -1
  572. package/dist/simple-tree/node-kinds/array/arrayNodeTypes.d.ts.map +1 -1
  573. package/dist/simple-tree/node-kinds/array/arrayNodeTypes.js.map +1 -1
  574. package/dist/simple-tree/node-kinds/common.d.ts.map +1 -1
  575. package/dist/simple-tree/node-kinds/common.js +1 -1
  576. package/dist/simple-tree/node-kinds/common.js.map +1 -1
  577. package/dist/simple-tree/node-kinds/map/mapNode.d.ts +2 -2
  578. package/dist/simple-tree/node-kinds/map/mapNode.d.ts.map +1 -1
  579. package/dist/simple-tree/node-kinds/map/mapNode.js +26 -26
  580. package/dist/simple-tree/node-kinds/map/mapNode.js.map +1 -1
  581. package/dist/simple-tree/node-kinds/map/mapNodeTypes.d.ts +1 -1
  582. package/dist/simple-tree/node-kinds/map/mapNodeTypes.d.ts.map +1 -1
  583. package/dist/simple-tree/node-kinds/map/mapNodeTypes.js.map +1 -1
  584. package/dist/simple-tree/node-kinds/object/objectNode.d.ts +2 -2
  585. package/dist/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -1
  586. package/dist/simple-tree/node-kinds/object/objectNode.js +28 -28
  587. package/dist/simple-tree/node-kinds/object/objectNode.js.map +1 -1
  588. package/dist/simple-tree/node-kinds/object/objectNodeTypes.d.ts +3 -3
  589. package/dist/simple-tree/node-kinds/object/objectNodeTypes.d.ts.map +1 -1
  590. package/dist/simple-tree/node-kinds/object/objectNodeTypes.js.map +1 -1
  591. package/dist/simple-tree/node-kinds/record/recordNode.d.ts +1 -1
  592. package/dist/simple-tree/node-kinds/record/recordNode.d.ts.map +1 -1
  593. package/dist/simple-tree/node-kinds/record/recordNode.js +36 -38
  594. package/dist/simple-tree/node-kinds/record/recordNode.js.map +1 -1
  595. package/dist/simple-tree/node-kinds/record/recordNodeTypes.d.ts +1 -1
  596. package/dist/simple-tree/node-kinds/record/recordNodeTypes.d.ts.map +1 -1
  597. package/dist/simple-tree/node-kinds/record/recordNodeTypes.js.map +1 -1
  598. package/dist/simple-tree/prepareForInsertion.d.ts +47 -54
  599. package/dist/simple-tree/prepareForInsertion.d.ts.map +1 -1
  600. package/dist/simple-tree/prepareForInsertion.js +128 -186
  601. package/dist/simple-tree/prepareForInsertion.js.map +1 -1
  602. package/dist/simple-tree/simpleSchema.d.ts.map +1 -1
  603. package/dist/simple-tree/simpleSchema.js.map +1 -1
  604. package/dist/simple-tree/treeSchema.d.ts.map +1 -1
  605. package/dist/simple-tree/treeSchema.js.map +1 -1
  606. package/dist/simple-tree/unhydratedFlexTreeFromInsertable.d.ts +4 -13
  607. package/dist/simple-tree/unhydratedFlexTreeFromInsertable.d.ts.map +1 -1
  608. package/dist/simple-tree/unhydratedFlexTreeFromInsertable.js +22 -40
  609. package/dist/simple-tree/unhydratedFlexTreeFromInsertable.js.map +1 -1
  610. package/dist/tableSchema.d.ts.map +1 -1
  611. package/dist/tableSchema.js +22 -21
  612. package/dist/tableSchema.js.map +1 -1
  613. package/dist/text/index.d.ts +1 -0
  614. package/dist/text/index.d.ts.map +1 -1
  615. package/dist/text/index.js +3 -1
  616. package/dist/text/index.js.map +1 -1
  617. package/dist/text/textDomain.d.ts +8 -0
  618. package/dist/text/textDomain.d.ts.map +1 -1
  619. package/dist/text/textDomain.js +2 -1
  620. package/dist/text/textDomain.js.map +1 -1
  621. package/dist/text/textDomainFormatted.d.ts +572 -0
  622. package/dist/text/textDomainFormatted.d.ts.map +1 -0
  623. package/dist/text/textDomainFormatted.js +183 -0
  624. package/dist/text/textDomainFormatted.js.map +1 -0
  625. package/dist/treeFactory.d.ts.map +1 -1
  626. package/dist/treeFactory.js +11 -21
  627. package/dist/treeFactory.js.map +1 -1
  628. package/dist/util/bTreeUtils.d.ts.map +1 -1
  629. package/dist/util/bTreeUtils.js +1 -1
  630. package/dist/util/bTreeUtils.js.map +1 -1
  631. package/dist/util/index.d.ts +1 -1
  632. package/dist/util/index.d.ts.map +1 -1
  633. package/dist/util/index.js +1 -2
  634. package/dist/util/index.js.map +1 -1
  635. package/dist/util/rangeMap.d.ts +12 -24
  636. package/dist/util/rangeMap.d.ts.map +1 -1
  637. package/dist/util/rangeMap.js +6 -46
  638. package/dist/util/rangeMap.js.map +1 -1
  639. package/dist/util/readSnapshotBlob.d.ts +1 -1
  640. package/dist/util/readSnapshotBlob.d.ts.map +1 -1
  641. package/dist/util/readSnapshotBlob.js.map +1 -1
  642. package/docs/main/sequence-field/move-composition.md +46 -0
  643. package/eslint.config.mts +4 -4
  644. package/lib/codec/codec.d.ts +2 -2
  645. package/lib/codec/codec.d.ts.map +1 -1
  646. package/lib/codec/codec.js +1 -1
  647. package/lib/codec/codec.js.map +1 -1
  648. package/lib/codec/versioned/codec.d.ts +1 -1
  649. package/lib/codec/versioned/codec.d.ts.map +1 -1
  650. package/lib/codec/versioned/codec.js +2 -2
  651. package/lib/codec/versioned/codec.js.map +1 -1
  652. package/lib/core/change-family/changeFamily.d.ts +1 -4
  653. package/lib/core/change-family/changeFamily.d.ts.map +1 -1
  654. package/lib/core/change-family/changeFamily.js.map +1 -1
  655. package/lib/core/change-family/index.d.ts +1 -1
  656. package/lib/core/change-family/index.d.ts.map +1 -1
  657. package/lib/core/change-family/index.js.map +1 -1
  658. package/lib/core/index.d.ts +3 -3
  659. package/lib/core/index.d.ts.map +1 -1
  660. package/lib/core/index.js +2 -2
  661. package/lib/core/index.js.map +1 -1
  662. package/lib/core/rebase/changeRebaser.d.ts +1 -6
  663. package/lib/core/rebase/changeRebaser.d.ts.map +1 -1
  664. package/lib/core/rebase/changeRebaser.js.map +1 -1
  665. package/lib/core/rebase/index.d.ts +1 -1
  666. package/lib/core/rebase/index.d.ts.map +1 -1
  667. package/lib/core/rebase/index.js +1 -1
  668. package/lib/core/rebase/index.js.map +1 -1
  669. package/lib/core/rebase/types.d.ts +1 -2
  670. package/lib/core/rebase/types.d.ts.map +1 -1
  671. package/lib/core/rebase/types.js +0 -3
  672. package/lib/core/rebase/types.js.map +1 -1
  673. package/lib/core/rebase/utils.d.ts.map +1 -1
  674. package/lib/core/rebase/utils.js +7 -25
  675. package/lib/core/rebase/utils.js.map +1 -1
  676. package/lib/core/schema-stored/formatV2.d.ts.map +1 -1
  677. package/lib/core/schema-stored/formatV2.js +1 -1
  678. package/lib/core/schema-stored/formatV2.js.map +1 -1
  679. package/lib/core/tree/anchorSet.d.ts.map +1 -1
  680. package/lib/core/tree/anchorSet.js +1 -1
  681. package/lib/core/tree/anchorSet.js.map +1 -1
  682. package/lib/core/tree/detachedFieldIndex.d.ts +0 -6
  683. package/lib/core/tree/detachedFieldIndex.d.ts.map +1 -1
  684. package/lib/core/tree/detachedFieldIndex.js +1 -10
  685. package/lib/core/tree/detachedFieldIndex.js.map +1 -1
  686. package/lib/core/tree/detachedFieldIndexCodecCommon.d.ts +1 -1
  687. package/lib/core/tree/detachedFieldIndexCodecCommon.d.ts.map +1 -1
  688. package/lib/core/tree/detachedFieldIndexCodecCommon.js.map +1 -1
  689. package/lib/core/tree/detachedFieldIndexCodecV1.d.ts.map +1 -1
  690. package/lib/core/tree/detachedFieldIndexCodecV1.js +1 -1
  691. package/lib/core/tree/detachedFieldIndexCodecV1.js.map +1 -1
  692. package/lib/core/tree/detachedFieldIndexCodecV2.d.ts.map +1 -1
  693. package/lib/core/tree/detachedFieldIndexCodecV2.js +2 -2
  694. package/lib/core/tree/detachedFieldIndexCodecV2.js.map +1 -1
  695. package/lib/core/tree/detachedFieldIndexFormatV1.d.ts.map +1 -1
  696. package/lib/core/tree/detachedFieldIndexFormatV1.js +2 -2
  697. package/lib/core/tree/detachedFieldIndexFormatV1.js.map +1 -1
  698. package/lib/core/tree/detachedFieldIndexFormatV2.d.ts.map +1 -1
  699. package/lib/core/tree/detachedFieldIndexFormatV2.js +2 -2
  700. package/lib/core/tree/detachedFieldIndexFormatV2.js.map +1 -1
  701. package/lib/core/tree/index.d.ts +1 -1
  702. package/lib/core/tree/index.d.ts.map +1 -1
  703. package/lib/core/tree/index.js +1 -1
  704. package/lib/core/tree/index.js.map +1 -1
  705. package/lib/core/tree/pathTree.d.ts +3 -11
  706. package/lib/core/tree/pathTree.d.ts.map +1 -1
  707. package/lib/core/tree/pathTree.js +1 -12
  708. package/lib/core/tree/pathTree.js.map +1 -1
  709. package/lib/core/tree/visitDelta.d.ts +1 -1
  710. package/lib/core/tree/visitDelta.d.ts.map +1 -1
  711. package/lib/core/tree/visitDelta.js.map +1 -1
  712. package/lib/core/tree/visitorUtils.d.ts.map +1 -1
  713. package/lib/core/tree/visitorUtils.js +1 -1
  714. package/lib/core/tree/visitorUtils.js.map +1 -1
  715. package/lib/feature-libraries/changeAtomIdBTree.d.ts +3 -4
  716. package/lib/feature-libraries/changeAtomIdBTree.d.ts.map +1 -1
  717. package/lib/feature-libraries/changeAtomIdBTree.js +1 -14
  718. package/lib/feature-libraries/changeAtomIdBTree.js.map +1 -1
  719. package/lib/feature-libraries/chunked-forest/basicChunk.d.ts.map +1 -1
  720. package/lib/feature-libraries/chunked-forest/basicChunk.js +1 -8
  721. package/lib/feature-libraries/chunked-forest/basicChunk.js.map +1 -1
  722. package/lib/feature-libraries/chunked-forest/chunkTree.d.ts +1 -1
  723. package/lib/feature-libraries/chunked-forest/chunkTree.d.ts.map +1 -1
  724. package/lib/feature-libraries/chunked-forest/chunkTree.js +1 -4
  725. package/lib/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
  726. package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts +1 -1
  727. package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.d.ts.map +1 -1
  728. package/lib/feature-libraries/chunked-forest/codec/chunkDecoding.js.map +1 -1
  729. package/lib/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts +1 -1
  730. package/lib/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.d.ts.map +1 -1
  731. package/lib/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.js.map +1 -1
  732. package/lib/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.d.ts +1 -1
  733. package/lib/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.d.ts.map +1 -1
  734. package/lib/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.js.map +1 -1
  735. package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts +1 -1
  736. package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
  737. package/lib/feature-libraries/chunked-forest/codec/codecs.js +1 -1
  738. package/lib/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
  739. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.d.ts +1 -1
  740. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.d.ts.map +1 -1
  741. package/lib/feature-libraries/chunked-forest/codec/compressedEncode.js.map +1 -1
  742. package/lib/feature-libraries/chunked-forest/codec/format.d.ts.map +1 -1
  743. package/lib/feature-libraries/chunked-forest/codec/format.js +1 -1
  744. package/lib/feature-libraries/chunked-forest/codec/format.js.map +1 -1
  745. package/lib/feature-libraries/chunked-forest/codec/formatGeneric.d.ts.map +1 -1
  746. package/lib/feature-libraries/chunked-forest/codec/formatGeneric.js.map +1 -1
  747. package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.d.ts +1 -1
  748. package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.d.ts.map +1 -1
  749. package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.js +2 -2
  750. package/lib/feature-libraries/chunked-forest/codec/schemaBasedEncode.js.map +1 -1
  751. package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts +44 -93
  752. package/lib/feature-libraries/default-schema/defaultEditBuilder.d.ts.map +1 -1
  753. package/lib/feature-libraries/default-schema/defaultEditBuilder.js +73 -237
  754. package/lib/feature-libraries/default-schema/defaultEditBuilder.js.map +1 -1
  755. package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts +11 -53
  756. package/lib/feature-libraries/default-schema/defaultFieldKinds.d.ts.map +1 -1
  757. package/lib/feature-libraries/default-schema/defaultFieldKinds.js +6 -56
  758. package/lib/feature-libraries/default-schema/defaultFieldKinds.js.map +1 -1
  759. package/lib/feature-libraries/default-schema/index.d.ts +2 -3
  760. package/lib/feature-libraries/default-schema/index.d.ts.map +1 -1
  761. package/lib/feature-libraries/default-schema/index.js +1 -2
  762. package/lib/feature-libraries/default-schema/index.js.map +1 -1
  763. package/lib/feature-libraries/default-schema/mappedEditBuilder.d.ts +6 -7
  764. package/lib/feature-libraries/default-schema/mappedEditBuilder.d.ts.map +1 -1
  765. package/lib/feature-libraries/default-schema/mappedEditBuilder.js +0 -15
  766. package/lib/feature-libraries/default-schema/mappedEditBuilder.js.map +1 -1
  767. package/lib/feature-libraries/deltaUtils.d.ts +0 -1
  768. package/lib/feature-libraries/deltaUtils.d.ts.map +1 -1
  769. package/lib/feature-libraries/deltaUtils.js +1 -5
  770. package/lib/feature-libraries/deltaUtils.js.map +1 -1
  771. package/lib/feature-libraries/fieldKindIdentifiers.d.ts +9 -0
  772. package/lib/feature-libraries/fieldKindIdentifiers.d.ts.map +1 -0
  773. package/lib/feature-libraries/fieldKindIdentifiers.js +13 -0
  774. package/lib/feature-libraries/fieldKindIdentifiers.js.map +1 -0
  775. package/lib/feature-libraries/flex-tree/context.d.ts +0 -9
  776. package/lib/feature-libraries/flex-tree/context.d.ts.map +1 -1
  777. package/lib/feature-libraries/flex-tree/context.js +0 -6
  778. package/lib/feature-libraries/flex-tree/context.js.map +1 -1
  779. package/lib/feature-libraries/flex-tree/flexTreeTypes.d.ts +6 -6
  780. package/lib/feature-libraries/flex-tree/flexTreeTypes.d.ts.map +1 -1
  781. package/lib/feature-libraries/flex-tree/flexTreeTypes.js.map +1 -1
  782. package/lib/feature-libraries/flex-tree/lazyField.d.ts +7 -8
  783. package/lib/feature-libraries/flex-tree/lazyField.d.ts.map +1 -1
  784. package/lib/feature-libraries/flex-tree/lazyField.js +11 -42
  785. package/lib/feature-libraries/flex-tree/lazyField.js.map +1 -1
  786. package/lib/feature-libraries/flex-tree/observer.d.ts +1 -1
  787. package/lib/feature-libraries/flex-tree/observer.d.ts.map +1 -1
  788. package/lib/feature-libraries/flex-tree/observer.js.map +1 -1
  789. package/lib/feature-libraries/forest-summary/codec.d.ts.map +1 -1
  790. package/lib/feature-libraries/forest-summary/codec.js +1 -1
  791. package/lib/feature-libraries/forest-summary/codec.js.map +1 -1
  792. package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
  793. package/lib/feature-libraries/forest-summary/forestSummarizer.js +3 -3
  794. package/lib/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
  795. package/lib/feature-libraries/forest-summary/formatV1.d.ts.map +1 -1
  796. package/lib/feature-libraries/forest-summary/formatV1.js.map +1 -1
  797. package/lib/feature-libraries/forest-summary/formatV2.d.ts.map +1 -1
  798. package/lib/feature-libraries/forest-summary/formatV2.js.map +1 -1
  799. package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts +4 -4
  800. package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts.map +1 -1
  801. package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.js +2 -2
  802. package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.js.map +1 -1
  803. package/lib/feature-libraries/forest-summary/summaryTypes.d.ts.map +1 -1
  804. package/lib/feature-libraries/forest-summary/summaryTypes.js.map +1 -1
  805. package/lib/feature-libraries/index.d.ts +3 -3
  806. package/lib/feature-libraries/index.d.ts.map +1 -1
  807. package/lib/feature-libraries/index.js +2 -2
  808. package/lib/feature-libraries/index.js.map +1 -1
  809. package/lib/feature-libraries/mapTreeCursor.d.ts.map +1 -1
  810. package/lib/feature-libraries/mapTreeCursor.js +1 -2
  811. package/lib/feature-libraries/mapTreeCursor.js.map +1 -1
  812. package/lib/feature-libraries/mitigatedChangeFamily.d.ts.map +1 -1
  813. package/lib/feature-libraries/mitigatedChangeFamily.js +2 -2
  814. package/lib/feature-libraries/mitigatedChangeFamily.js.map +1 -1
  815. package/lib/feature-libraries/modular-schema/crossFieldQueries.d.ts +21 -97
  816. package/lib/feature-libraries/modular-schema/crossFieldQueries.d.ts.map +1 -1
  817. package/lib/feature-libraries/modular-schema/crossFieldQueries.js +5 -3
  818. package/lib/feature-libraries/modular-schema/crossFieldQueries.js.map +1 -1
  819. package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts +51 -20
  820. package/lib/feature-libraries/modular-schema/fieldChangeHandler.d.ts.map +1 -1
  821. package/lib/feature-libraries/modular-schema/fieldChangeHandler.js.map +1 -1
  822. package/lib/feature-libraries/modular-schema/fieldKindConfiguration.d.ts.map +1 -1
  823. package/lib/feature-libraries/modular-schema/fieldKindConfiguration.js.map +1 -1
  824. package/lib/feature-libraries/modular-schema/genericFieldKind.d.ts +1 -1
  825. package/lib/feature-libraries/modular-schema/genericFieldKind.d.ts.map +1 -1
  826. package/lib/feature-libraries/modular-schema/genericFieldKind.js +11 -5
  827. package/lib/feature-libraries/modular-schema/genericFieldKind.js.map +1 -1
  828. package/lib/feature-libraries/modular-schema/index.d.ts +4 -4
  829. package/lib/feature-libraries/modular-schema/index.d.ts.map +1 -1
  830. package/lib/feature-libraries/modular-schema/index.js +2 -2
  831. package/lib/feature-libraries/modular-schema/index.js.map +1 -1
  832. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.d.ts +28 -11
  833. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.d.ts.map +1 -1
  834. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.js +144 -246
  835. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.js.map +1 -1
  836. package/lib/feature-libraries/modular-schema/modularChangeCodecV2.d.ts.map +1 -1
  837. package/lib/feature-libraries/modular-schema/modularChangeCodecV2.js +1 -1
  838. package/lib/feature-libraries/modular-schema/modularChangeCodecV2.js.map +1 -1
  839. package/lib/feature-libraries/modular-schema/modularChangeCodecs.d.ts.map +1 -1
  840. package/lib/feature-libraries/modular-schema/modularChangeCodecs.js +1 -8
  841. package/lib/feature-libraries/modular-schema/modularChangeCodecs.js.map +1 -1
  842. package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts +21 -49
  843. package/lib/feature-libraries/modular-schema/modularChangeFamily.d.ts.map +1 -1
  844. package/lib/feature-libraries/modular-schema/modularChangeFamily.js +463 -1319
  845. package/lib/feature-libraries/modular-schema/modularChangeFamily.js.map +1 -1
  846. package/lib/feature-libraries/modular-schema/modularChangeFormatV1.d.ts.map +1 -1
  847. package/lib/feature-libraries/modular-schema/modularChangeFormatV1.js.map +1 -1
  848. package/lib/feature-libraries/modular-schema/modularChangeTypes.d.ts +8 -44
  849. package/lib/feature-libraries/modular-schema/modularChangeTypes.d.ts.map +1 -1
  850. package/lib/feature-libraries/modular-schema/modularChangeTypes.js +1 -1
  851. package/lib/feature-libraries/modular-schema/modularChangeTypes.js.map +1 -1
  852. package/lib/feature-libraries/object-forest/objectForest.d.ts.map +1 -1
  853. package/lib/feature-libraries/object-forest/objectForest.js +2 -2
  854. package/lib/feature-libraries/object-forest/objectForest.js.map +1 -1
  855. package/lib/feature-libraries/optional-field/index.d.ts +2 -2
  856. package/lib/feature-libraries/optional-field/index.d.ts.map +1 -1
  857. package/lib/feature-libraries/optional-field/index.js +2 -2
  858. package/lib/feature-libraries/optional-field/index.js.map +1 -1
  859. package/lib/feature-libraries/optional-field/optionalField.d.ts +34 -5
  860. package/lib/feature-libraries/optional-field/optionalField.d.ts.map +1 -1
  861. package/lib/feature-libraries/optional-field/optionalField.js +453 -221
  862. package/lib/feature-libraries/optional-field/optionalField.js.map +1 -1
  863. package/lib/feature-libraries/optional-field/optionalFieldChangeTypes.d.ts +33 -24
  864. package/lib/feature-libraries/optional-field/optionalFieldChangeTypes.d.ts.map +1 -1
  865. package/lib/feature-libraries/optional-field/optionalFieldChangeTypes.js.map +1 -1
  866. package/lib/feature-libraries/optional-field/optionalFieldCodecV2.d.ts +1 -1
  867. package/lib/feature-libraries/optional-field/optionalFieldCodecV2.d.ts.map +1 -1
  868. package/lib/feature-libraries/optional-field/optionalFieldCodecV2.js +26 -55
  869. package/lib/feature-libraries/optional-field/optionalFieldCodecV2.js.map +1 -1
  870. package/lib/feature-libraries/optional-field/optionalFieldCodecs.d.ts.map +1 -1
  871. package/lib/feature-libraries/optional-field/optionalFieldCodecs.js +1 -5
  872. package/lib/feature-libraries/optional-field/optionalFieldCodecs.js.map +1 -1
  873. package/lib/feature-libraries/optional-field/requiredField.d.ts +36 -0
  874. package/lib/feature-libraries/optional-field/requiredField.d.ts.map +1 -0
  875. package/lib/feature-libraries/optional-field/requiredField.js +24 -0
  876. package/lib/feature-libraries/optional-field/requiredField.js.map +1 -0
  877. package/lib/feature-libraries/schema-edits/schemaChangeCodecs.d.ts +1 -1
  878. package/lib/feature-libraries/schema-edits/schemaChangeCodecs.d.ts.map +1 -1
  879. package/lib/feature-libraries/schema-edits/schemaChangeCodecs.js +1 -1
  880. package/lib/feature-libraries/schema-edits/schemaChangeCodecs.js.map +1 -1
  881. package/lib/feature-libraries/schema-edits/schemaChangeFormat.d.ts.map +1 -1
  882. package/lib/feature-libraries/schema-edits/schemaChangeFormat.js.map +1 -1
  883. package/lib/feature-libraries/schemaChecker.d.ts.map +1 -1
  884. package/lib/feature-libraries/schemaChecker.js +1 -1
  885. package/lib/feature-libraries/schemaChecker.js.map +1 -1
  886. package/lib/feature-libraries/sequence-field/compose.d.ts +7 -6
  887. package/lib/feature-libraries/sequence-field/compose.d.ts.map +1 -1
  888. package/lib/feature-libraries/sequence-field/compose.js +261 -85
  889. package/lib/feature-libraries/sequence-field/compose.js.map +1 -1
  890. package/lib/feature-libraries/sequence-field/helperTypes.d.ts +10 -14
  891. package/lib/feature-libraries/sequence-field/helperTypes.d.ts.map +1 -1
  892. package/lib/feature-libraries/sequence-field/helperTypes.js.map +1 -1
  893. package/lib/feature-libraries/sequence-field/index.d.ts +2 -13
  894. package/lib/feature-libraries/sequence-field/index.d.ts.map +1 -1
  895. package/lib/feature-libraries/sequence-field/index.js +1 -12
  896. package/lib/feature-libraries/sequence-field/index.js.map +1 -1
  897. package/lib/feature-libraries/sequence-field/invert.d.ts +3 -3
  898. package/lib/feature-libraries/sequence-field/invert.d.ts.map +1 -1
  899. package/lib/feature-libraries/sequence-field/invert.js +169 -67
  900. package/lib/feature-libraries/sequence-field/invert.js.map +1 -1
  901. package/lib/feature-libraries/sequence-field/markQueue.d.ts +2 -2
  902. package/lib/feature-libraries/sequence-field/markQueue.d.ts.map +1 -1
  903. package/lib/feature-libraries/sequence-field/markQueue.js.map +1 -1
  904. package/lib/feature-libraries/sequence-field/moveEffectTable.d.ts +56 -4
  905. package/lib/feature-libraries/sequence-field/moveEffectTable.d.ts.map +1 -1
  906. package/lib/feature-libraries/sequence-field/moveEffectTable.js +84 -6
  907. package/lib/feature-libraries/sequence-field/moveEffectTable.js.map +1 -1
  908. package/lib/feature-libraries/sequence-field/rebase.d.ts +3 -3
  909. package/lib/feature-libraries/sequence-field/rebase.d.ts.map +1 -1
  910. package/lib/feature-libraries/sequence-field/rebase.js +116 -109
  911. package/lib/feature-libraries/sequence-field/rebase.js.map +1 -1
  912. package/lib/feature-libraries/sequence-field/relevantRemovedRoots.d.ts +9 -0
  913. package/lib/feature-libraries/sequence-field/relevantRemovedRoots.d.ts.map +1 -0
  914. package/lib/feature-libraries/sequence-field/relevantRemovedRoots.js +46 -0
  915. package/lib/feature-libraries/sequence-field/relevantRemovedRoots.js.map +1 -0
  916. package/lib/feature-libraries/sequence-field/replaceRevisions.d.ts.map +1 -1
  917. package/lib/feature-libraries/sequence-field/replaceRevisions.js +31 -18
  918. package/lib/feature-libraries/sequence-field/replaceRevisions.js.map +1 -1
  919. package/lib/feature-libraries/sequence-field/sequenceFieldChangeHandler.d.ts.map +1 -1
  920. package/lib/feature-libraries/sequence-field/sequenceFieldChangeHandler.js +2 -0
  921. package/lib/feature-libraries/sequence-field/sequenceFieldChangeHandler.js.map +1 -1
  922. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts +4 -22
  923. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.d.ts.map +1 -1
  924. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.js +182 -356
  925. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV2.js.map +1 -1
  926. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.d.ts.map +1 -1
  927. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.js +63 -21
  928. package/lib/feature-libraries/sequence-field/sequenceFieldCodecV3.js.map +1 -1
  929. package/lib/feature-libraries/sequence-field/sequenceFieldEditor.d.ts +2 -2
  930. package/lib/feature-libraries/sequence-field/sequenceFieldEditor.d.ts.map +1 -1
  931. package/lib/feature-libraries/sequence-field/sequenceFieldEditor.js +10 -10
  932. package/lib/feature-libraries/sequence-field/sequenceFieldEditor.js.map +1 -1
  933. package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.d.ts +2 -3
  934. package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.d.ts.map +1 -1
  935. package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.js +109 -14
  936. package/lib/feature-libraries/sequence-field/sequenceFieldToDelta.js.map +1 -1
  937. package/lib/feature-libraries/sequence-field/sequenceKind.d.ts +16 -0
  938. package/lib/feature-libraries/sequence-field/sequenceKind.d.ts.map +1 -0
  939. package/lib/feature-libraries/sequence-field/sequenceKind.js +21 -0
  940. package/lib/feature-libraries/sequence-field/sequenceKind.js.map +1 -0
  941. package/lib/feature-libraries/sequence-field/types.d.ts +59 -30
  942. package/lib/feature-libraries/sequence-field/types.d.ts.map +1 -1
  943. package/lib/feature-libraries/sequence-field/types.js.map +1 -1
  944. package/lib/feature-libraries/sequence-field/utils.d.ts +24 -15
  945. package/lib/feature-libraries/sequence-field/utils.d.ts.map +1 -1
  946. package/lib/feature-libraries/sequence-field/utils.js +298 -112
  947. package/lib/feature-libraries/sequence-field/utils.js.map +1 -1
  948. package/lib/index.d.ts +1 -1
  949. package/lib/index.d.ts.map +1 -1
  950. package/lib/index.js +1 -1
  951. package/lib/index.js.map +1 -1
  952. package/lib/packageVersion.d.ts +1 -1
  953. package/lib/packageVersion.d.ts.map +1 -1
  954. package/lib/packageVersion.js +1 -1
  955. package/lib/packageVersion.js.map +1 -1
  956. package/lib/shared-tree/independentView.d.ts.map +1 -1
  957. package/lib/shared-tree/independentView.js +3 -3
  958. package/lib/shared-tree/independentView.js.map +1 -1
  959. package/lib/shared-tree/index.d.ts +1 -1
  960. package/lib/shared-tree/index.d.ts.map +1 -1
  961. package/lib/shared-tree/index.js.map +1 -1
  962. package/lib/shared-tree/schematizeTree.d.ts +4 -4
  963. package/lib/shared-tree/schematizeTree.d.ts.map +1 -1
  964. package/lib/shared-tree/schematizeTree.js +2 -3
  965. package/lib/shared-tree/schematizeTree.js.map +1 -1
  966. package/lib/shared-tree/schematizingTreeView.d.ts +5 -1
  967. package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
  968. package/lib/shared-tree/schematizingTreeView.js +42 -43
  969. package/lib/shared-tree/schematizingTreeView.js.map +1 -1
  970. package/lib/shared-tree/sharedTree.d.ts +5 -11
  971. package/lib/shared-tree/sharedTree.d.ts.map +1 -1
  972. package/lib/shared-tree/sharedTree.js +5 -43
  973. package/lib/shared-tree/sharedTree.js.map +1 -1
  974. package/lib/shared-tree/sharedTreeChangeCodecs.d.ts +1 -1
  975. package/lib/shared-tree/sharedTreeChangeCodecs.d.ts.map +1 -1
  976. package/lib/shared-tree/sharedTreeChangeCodecs.js +0 -1
  977. package/lib/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
  978. package/lib/shared-tree/sharedTreeChangeEnricher.d.ts +31 -24
  979. package/lib/shared-tree/sharedTreeChangeEnricher.d.ts.map +1 -1
  980. package/lib/shared-tree/sharedTreeChangeEnricher.js +74 -56
  981. package/lib/shared-tree/sharedTreeChangeEnricher.js.map +1 -1
  982. package/lib/shared-tree/sharedTreeChangeFamily.d.ts +5 -5
  983. package/lib/shared-tree/sharedTreeChangeFamily.d.ts.map +1 -1
  984. package/lib/shared-tree/sharedTreeChangeFamily.js +5 -11
  985. package/lib/shared-tree/sharedTreeChangeFamily.js.map +1 -1
  986. package/lib/shared-tree/sharedTreeEditBuilder.d.ts +6 -16
  987. package/lib/shared-tree/sharedTreeEditBuilder.d.ts.map +1 -1
  988. package/lib/shared-tree/sharedTreeEditBuilder.js +6 -12
  989. package/lib/shared-tree/sharedTreeEditBuilder.js.map +1 -1
  990. package/lib/shared-tree/tree.d.ts.map +1 -1
  991. package/lib/shared-tree/tree.js +7 -7
  992. package/lib/shared-tree/tree.js.map +1 -1
  993. package/lib/shared-tree/treeAlpha.d.ts +1 -1
  994. package/lib/shared-tree/treeAlpha.d.ts.map +1 -1
  995. package/lib/shared-tree/treeAlpha.js +3 -3
  996. package/lib/shared-tree/treeAlpha.js.map +1 -1
  997. package/lib/shared-tree/treeCheckout.d.ts +29 -13
  998. package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
  999. package/lib/shared-tree/treeCheckout.js +55 -54
  1000. package/lib/shared-tree/treeCheckout.js.map +1 -1
  1001. package/lib/shared-tree-core/branch.d.ts +3 -4
  1002. package/lib/shared-tree-core/branch.d.ts.map +1 -1
  1003. package/lib/shared-tree-core/branch.js +3 -4
  1004. package/lib/shared-tree-core/branch.js.map +1 -1
  1005. package/lib/shared-tree-core/branchCommitEnricher.d.ts +18 -31
  1006. package/lib/shared-tree-core/branchCommitEnricher.d.ts.map +1 -1
  1007. package/lib/shared-tree-core/branchCommitEnricher.js +24 -76
  1008. package/lib/shared-tree-core/branchCommitEnricher.js.map +1 -1
  1009. package/lib/shared-tree-core/branchIdCodec.d.ts.map +1 -1
  1010. package/lib/shared-tree-core/branchIdCodec.js.map +1 -1
  1011. package/lib/shared-tree-core/changeEnricher.d.ts +8 -43
  1012. package/lib/shared-tree-core/changeEnricher.d.ts.map +1 -1
  1013. package/lib/shared-tree-core/changeEnricher.js +1 -11
  1014. package/lib/shared-tree-core/changeEnricher.js.map +1 -1
  1015. package/lib/shared-tree-core/defaultResubmitMachine.d.ts +4 -12
  1016. package/lib/shared-tree-core/defaultResubmitMachine.d.ts.map +1 -1
  1017. package/lib/shared-tree-core/defaultResubmitMachine.js +28 -38
  1018. package/lib/shared-tree-core/defaultResubmitMachine.js.map +1 -1
  1019. package/lib/shared-tree-core/editManager.d.ts +3 -3
  1020. package/lib/shared-tree-core/editManager.d.ts.map +1 -1
  1021. package/lib/shared-tree-core/editManager.js +11 -11
  1022. package/lib/shared-tree-core/editManager.js.map +1 -1
  1023. package/lib/shared-tree-core/editManagerCodecs.d.ts +1 -5
  1024. package/lib/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
  1025. package/lib/shared-tree-core/editManagerCodecs.js +1 -8
  1026. package/lib/shared-tree-core/editManagerCodecs.js.map +1 -1
  1027. package/lib/shared-tree-core/editManagerCodecsCommons.d.ts +1 -1
  1028. package/lib/shared-tree-core/editManagerCodecsCommons.d.ts.map +1 -1
  1029. package/lib/shared-tree-core/editManagerCodecsCommons.js +1 -2
  1030. package/lib/shared-tree-core/editManagerCodecsCommons.js.map +1 -1
  1031. package/lib/shared-tree-core/editManagerCodecsV1toV4.d.ts.map +1 -1
  1032. package/lib/shared-tree-core/editManagerCodecsV1toV4.js +1 -1
  1033. package/lib/shared-tree-core/editManagerCodecsV1toV4.js.map +1 -1
  1034. package/lib/shared-tree-core/editManagerCodecsVSharedBranches.d.ts.map +1 -1
  1035. package/lib/shared-tree-core/editManagerCodecsVSharedBranches.js +1 -1
  1036. package/lib/shared-tree-core/editManagerCodecsVSharedBranches.js.map +1 -1
  1037. package/lib/shared-tree-core/editManagerFormatCommons.d.ts +0 -1
  1038. package/lib/shared-tree-core/editManagerFormatCommons.d.ts.map +1 -1
  1039. package/lib/shared-tree-core/editManagerFormatCommons.js +0 -6
  1040. package/lib/shared-tree-core/editManagerFormatCommons.js.map +1 -1
  1041. package/lib/shared-tree-core/editManagerFormatV1toV4.d.ts +2 -2
  1042. package/lib/shared-tree-core/editManagerFormatV1toV4.d.ts.map +1 -1
  1043. package/lib/shared-tree-core/editManagerFormatV1toV4.js +0 -1
  1044. package/lib/shared-tree-core/editManagerFormatV1toV4.js.map +1 -1
  1045. package/lib/shared-tree-core/editManagerFormatVSharedBranches.d.ts +1 -1
  1046. package/lib/shared-tree-core/editManagerFormatVSharedBranches.d.ts.map +1 -1
  1047. package/lib/shared-tree-core/editManagerFormatVSharedBranches.js +1 -1
  1048. package/lib/shared-tree-core/editManagerFormatVSharedBranches.js.map +1 -1
  1049. package/lib/shared-tree-core/index.d.ts +4 -4
  1050. package/lib/shared-tree-core/index.d.ts.map +1 -1
  1051. package/lib/shared-tree-core/index.js +2 -3
  1052. package/lib/shared-tree-core/index.js.map +1 -1
  1053. package/lib/shared-tree-core/messageCodecV1ToV4.d.ts +2 -2
  1054. package/lib/shared-tree-core/messageCodecV1ToV4.d.ts.map +1 -1
  1055. package/lib/shared-tree-core/messageCodecV1ToV4.js +1 -1
  1056. package/lib/shared-tree-core/messageCodecV1ToV4.js.map +1 -1
  1057. package/lib/shared-tree-core/messageCodecVSharedBranches.d.ts +1 -1
  1058. package/lib/shared-tree-core/messageCodecVSharedBranches.d.ts.map +1 -1
  1059. package/lib/shared-tree-core/messageCodecVSharedBranches.js +2 -2
  1060. package/lib/shared-tree-core/messageCodecVSharedBranches.js.map +1 -1
  1061. package/lib/shared-tree-core/messageCodecs.d.ts +2 -6
  1062. package/lib/shared-tree-core/messageCodecs.d.ts.map +1 -1
  1063. package/lib/shared-tree-core/messageCodecs.js +1 -8
  1064. package/lib/shared-tree-core/messageCodecs.js.map +1 -1
  1065. package/lib/shared-tree-core/messageFormat.d.ts +0 -1
  1066. package/lib/shared-tree-core/messageFormat.d.ts.map +1 -1
  1067. package/lib/shared-tree-core/messageFormat.js +0 -6
  1068. package/lib/shared-tree-core/messageFormat.js.map +1 -1
  1069. package/lib/shared-tree-core/messageFormatV1ToV4.d.ts +2 -2
  1070. package/lib/shared-tree-core/messageFormatV1ToV4.d.ts.map +1 -1
  1071. package/lib/shared-tree-core/messageFormatV1ToV4.js +0 -1
  1072. package/lib/shared-tree-core/messageFormatV1ToV4.js.map +1 -1
  1073. package/lib/shared-tree-core/messageFormatVSharedBranches.d.ts.map +1 -1
  1074. package/lib/shared-tree-core/messageFormatVSharedBranches.js.map +1 -1
  1075. package/lib/shared-tree-core/messageTypes.d.ts.map +1 -1
  1076. package/lib/shared-tree-core/messageTypes.js.map +1 -1
  1077. package/lib/shared-tree-core/sharedTreeCore.d.ts +8 -5
  1078. package/lib/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
  1079. package/lib/shared-tree-core/sharedTreeCore.js +15 -15
  1080. package/lib/shared-tree-core/sharedTreeCore.js.map +1 -1
  1081. package/lib/shared-tree-core/versionedSummarizer.d.ts.map +1 -1
  1082. package/lib/shared-tree-core/versionedSummarizer.js +1 -1
  1083. package/lib/shared-tree-core/versionedSummarizer.js.map +1 -1
  1084. package/lib/simple-tree/api/configuration.d.ts +2 -2
  1085. package/lib/simple-tree/api/configuration.d.ts.map +1 -1
  1086. package/lib/simple-tree/api/configuration.js +4 -4
  1087. package/lib/simple-tree/api/configuration.js.map +1 -1
  1088. package/lib/simple-tree/api/create.d.ts +1 -1
  1089. package/lib/simple-tree/api/create.d.ts.map +1 -1
  1090. package/lib/simple-tree/api/create.js +1 -1
  1091. package/lib/simple-tree/api/create.js.map +1 -1
  1092. package/lib/simple-tree/api/dirtyIndex.d.ts +1 -1
  1093. package/lib/simple-tree/api/dirtyIndex.d.ts.map +1 -1
  1094. package/lib/simple-tree/api/dirtyIndex.js.map +1 -1
  1095. package/lib/simple-tree/api/discrepancies.d.ts.map +1 -1
  1096. package/lib/simple-tree/api/discrepancies.js +3 -3
  1097. package/lib/simple-tree/api/discrepancies.js.map +1 -1
  1098. package/lib/simple-tree/api/getJsonSchema.d.ts +1 -1
  1099. package/lib/simple-tree/api/getJsonSchema.d.ts.map +1 -1
  1100. package/lib/simple-tree/api/getJsonSchema.js +1 -1
  1101. package/lib/simple-tree/api/getJsonSchema.js.map +1 -1
  1102. package/lib/simple-tree/api/identifierIndex.d.ts +2 -2
  1103. package/lib/simple-tree/api/identifierIndex.d.ts.map +1 -1
  1104. package/lib/simple-tree/api/identifierIndex.js.map +1 -1
  1105. package/lib/simple-tree/api/incrementalAllowedTypes.d.ts +1 -1
  1106. package/lib/simple-tree/api/incrementalAllowedTypes.d.ts.map +1 -1
  1107. package/lib/simple-tree/api/incrementalAllowedTypes.js +3 -3
  1108. package/lib/simple-tree/api/incrementalAllowedTypes.js.map +1 -1
  1109. package/lib/simple-tree/api/schemaCompatibilityTester.d.ts +1 -1
  1110. package/lib/simple-tree/api/schemaCompatibilityTester.d.ts.map +1 -1
  1111. package/lib/simple-tree/api/schemaCompatibilityTester.js +1 -1
  1112. package/lib/simple-tree/api/schemaCompatibilityTester.js.map +1 -1
  1113. package/lib/simple-tree/api/schemaCreationUtilities.d.ts +2 -2
  1114. package/lib/simple-tree/api/schemaCreationUtilities.d.ts.map +1 -1
  1115. package/lib/simple-tree/api/schemaCreationUtilities.js +1 -1
  1116. package/lib/simple-tree/api/schemaCreationUtilities.js.map +1 -1
  1117. package/lib/simple-tree/api/schemaFactory.d.ts +2 -2
  1118. package/lib/simple-tree/api/schemaFactory.d.ts.map +1 -1
  1119. package/lib/simple-tree/api/schemaFactory.js +2 -2
  1120. package/lib/simple-tree/api/schemaFactory.js.map +1 -1
  1121. package/lib/simple-tree/api/schemaFactoryAlpha.d.ts +6 -6
  1122. package/lib/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
  1123. package/lib/simple-tree/api/schemaFactoryAlpha.js +1 -1
  1124. package/lib/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
  1125. package/lib/simple-tree/api/schemaFactoryBeta.d.ts +2 -2
  1126. package/lib/simple-tree/api/schemaFactoryBeta.d.ts.map +1 -1
  1127. package/lib/simple-tree/api/schemaFactoryBeta.js +1 -0
  1128. package/lib/simple-tree/api/schemaFactoryBeta.js.map +1 -1
  1129. package/lib/simple-tree/api/schemaFactoryRecursive.d.ts +1 -1
  1130. package/lib/simple-tree/api/schemaFactoryRecursive.d.ts.map +1 -1
  1131. package/lib/simple-tree/api/schemaFactoryRecursive.js.map +1 -1
  1132. package/lib/simple-tree/api/schemaFromSimple.d.ts.map +1 -1
  1133. package/lib/simple-tree/api/schemaFromSimple.js.map +1 -1
  1134. package/lib/simple-tree/api/schemaStatics.d.ts.map +1 -1
  1135. package/lib/simple-tree/api/schemaStatics.js.map +1 -1
  1136. package/lib/simple-tree/api/simpleSchemaCodec.d.ts +1 -1
  1137. package/lib/simple-tree/api/simpleSchemaCodec.d.ts.map +1 -1
  1138. package/lib/simple-tree/api/simpleSchemaCodec.js +3 -3
  1139. package/lib/simple-tree/api/simpleSchemaCodec.js.map +1 -1
  1140. package/lib/simple-tree/api/simpleSchemaToJsonSchema.d.ts +2 -2
  1141. package/lib/simple-tree/api/simpleSchemaToJsonSchema.d.ts.map +1 -1
  1142. package/lib/simple-tree/api/simpleSchemaToJsonSchema.js +2 -2
  1143. package/lib/simple-tree/api/simpleSchemaToJsonSchema.js.map +1 -1
  1144. package/lib/simple-tree/api/simpleTreeIndex.d.ts +1 -1
  1145. package/lib/simple-tree/api/simpleTreeIndex.d.ts.map +1 -1
  1146. package/lib/simple-tree/api/simpleTreeIndex.js +1 -1
  1147. package/lib/simple-tree/api/simpleTreeIndex.js.map +1 -1
  1148. package/lib/simple-tree/api/snapshotCompatibilityChecker.d.ts.map +1 -1
  1149. package/lib/simple-tree/api/snapshotCompatibilityChecker.js +5 -5
  1150. package/lib/simple-tree/api/snapshotCompatibilityChecker.js.map +1 -1
  1151. package/lib/simple-tree/api/storedSchema.d.ts.map +1 -1
  1152. package/lib/simple-tree/api/storedSchema.js.map +1 -1
  1153. package/lib/simple-tree/api/tree.d.ts +2 -2
  1154. package/lib/simple-tree/api/tree.d.ts.map +1 -1
  1155. package/lib/simple-tree/api/tree.js.map +1 -1
  1156. package/lib/simple-tree/api/treeBeta.d.ts +1 -1
  1157. package/lib/simple-tree/api/treeBeta.d.ts.map +1 -1
  1158. package/lib/simple-tree/api/treeBeta.js +2 -2
  1159. package/lib/simple-tree/api/treeBeta.js.map +1 -1
  1160. package/lib/simple-tree/api/treeNodeApi.d.ts.map +1 -1
  1161. package/lib/simple-tree/api/treeNodeApi.js +4 -4
  1162. package/lib/simple-tree/api/treeNodeApi.js.map +1 -1
  1163. package/lib/simple-tree/api/typesUnsafe.d.ts +1 -1
  1164. package/lib/simple-tree/api/typesUnsafe.d.ts.map +1 -1
  1165. package/lib/simple-tree/api/typesUnsafe.js.map +1 -1
  1166. package/lib/simple-tree/api/verboseTree.d.ts +1 -1
  1167. package/lib/simple-tree/api/verboseTree.d.ts.map +1 -1
  1168. package/lib/simple-tree/api/verboseTree.js +3 -3
  1169. package/lib/simple-tree/api/verboseTree.js.map +1 -1
  1170. package/lib/simple-tree/core/allowedTypes.d.ts +1 -1
  1171. package/lib/simple-tree/core/allowedTypes.d.ts.map +1 -1
  1172. package/lib/simple-tree/core/allowedTypes.js +2 -2
  1173. package/lib/simple-tree/core/allowedTypes.js.map +1 -1
  1174. package/lib/simple-tree/core/context.d.ts.map +1 -1
  1175. package/lib/simple-tree/core/context.js.map +1 -1
  1176. package/lib/simple-tree/core/treeNode.d.ts.map +1 -1
  1177. package/lib/simple-tree/core/treeNode.js +1 -1
  1178. package/lib/simple-tree/core/treeNode.js.map +1 -1
  1179. package/lib/simple-tree/core/treeNodeKernel.d.ts.map +1 -1
  1180. package/lib/simple-tree/core/treeNodeKernel.js +1 -3
  1181. package/lib/simple-tree/core/treeNodeKernel.js.map +1 -1
  1182. package/lib/simple-tree/core/treeNodeSchema.d.ts +5 -5
  1183. package/lib/simple-tree/core/treeNodeSchema.d.ts.map +1 -1
  1184. package/lib/simple-tree/core/treeNodeSchema.js.map +1 -1
  1185. package/lib/simple-tree/core/treeNodeValid.d.ts +3 -3
  1186. package/lib/simple-tree/core/treeNodeValid.d.ts.map +1 -1
  1187. package/lib/simple-tree/core/treeNodeValid.js +2 -2
  1188. package/lib/simple-tree/core/treeNodeValid.js.map +1 -1
  1189. package/lib/simple-tree/core/unhydratedFlexTree.d.ts +16 -16
  1190. package/lib/simple-tree/core/unhydratedFlexTree.d.ts.map +1 -1
  1191. package/lib/simple-tree/core/unhydratedFlexTree.js +8 -58
  1192. package/lib/simple-tree/core/unhydratedFlexTree.js.map +1 -1
  1193. package/lib/simple-tree/core/withType.d.ts.map +1 -1
  1194. package/lib/simple-tree/core/withType.js.map +1 -1
  1195. package/lib/simple-tree/createContext.d.ts.map +1 -1
  1196. package/lib/simple-tree/createContext.js.map +1 -1
  1197. package/lib/simple-tree/fieldSchema.d.ts +5 -5
  1198. package/lib/simple-tree/fieldSchema.d.ts.map +1 -1
  1199. package/lib/simple-tree/fieldSchema.js.map +1 -1
  1200. package/lib/simple-tree/index.d.ts +2 -2
  1201. package/lib/simple-tree/index.d.ts.map +1 -1
  1202. package/lib/simple-tree/index.js +1 -1
  1203. package/lib/simple-tree/index.js.map +1 -1
  1204. package/lib/simple-tree/leafNodeSchema.d.ts +1 -1
  1205. package/lib/simple-tree/leafNodeSchema.d.ts.map +1 -1
  1206. package/lib/simple-tree/leafNodeSchema.js +2 -2
  1207. package/lib/simple-tree/leafNodeSchema.js.map +1 -1
  1208. package/lib/simple-tree/node-kinds/array/arrayNode.d.ts +1 -1
  1209. package/lib/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
  1210. package/lib/simple-tree/node-kinds/array/arrayNode.js +6 -8
  1211. package/lib/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
  1212. package/lib/simple-tree/node-kinds/array/arrayNodeTypes.d.ts +1 -1
  1213. package/lib/simple-tree/node-kinds/array/arrayNodeTypes.d.ts.map +1 -1
  1214. package/lib/simple-tree/node-kinds/array/arrayNodeTypes.js.map +1 -1
  1215. package/lib/simple-tree/node-kinds/common.d.ts.map +1 -1
  1216. package/lib/simple-tree/node-kinds/common.js +2 -2
  1217. package/lib/simple-tree/node-kinds/common.js.map +1 -1
  1218. package/lib/simple-tree/node-kinds/map/mapNode.d.ts +2 -2
  1219. package/lib/simple-tree/node-kinds/map/mapNode.d.ts.map +1 -1
  1220. package/lib/simple-tree/node-kinds/map/mapNode.js +8 -8
  1221. package/lib/simple-tree/node-kinds/map/mapNode.js.map +1 -1
  1222. package/lib/simple-tree/node-kinds/map/mapNodeTypes.d.ts +1 -1
  1223. package/lib/simple-tree/node-kinds/map/mapNodeTypes.d.ts.map +1 -1
  1224. package/lib/simple-tree/node-kinds/map/mapNodeTypes.js.map +1 -1
  1225. package/lib/simple-tree/node-kinds/object/objectNode.d.ts +2 -2
  1226. package/lib/simple-tree/node-kinds/object/objectNode.d.ts.map +1 -1
  1227. package/lib/simple-tree/node-kinds/object/objectNode.js +22 -22
  1228. package/lib/simple-tree/node-kinds/object/objectNode.js.map +1 -1
  1229. package/lib/simple-tree/node-kinds/object/objectNodeTypes.d.ts +3 -3
  1230. package/lib/simple-tree/node-kinds/object/objectNodeTypes.d.ts.map +1 -1
  1231. package/lib/simple-tree/node-kinds/object/objectNodeTypes.js.map +1 -1
  1232. package/lib/simple-tree/node-kinds/record/recordNode.d.ts +1 -1
  1233. package/lib/simple-tree/node-kinds/record/recordNode.d.ts.map +1 -1
  1234. package/lib/simple-tree/node-kinds/record/recordNode.js +6 -8
  1235. package/lib/simple-tree/node-kinds/record/recordNode.js.map +1 -1
  1236. package/lib/simple-tree/node-kinds/record/recordNodeTypes.d.ts +1 -1
  1237. package/lib/simple-tree/node-kinds/record/recordNodeTypes.d.ts.map +1 -1
  1238. package/lib/simple-tree/node-kinds/record/recordNodeTypes.js.map +1 -1
  1239. package/lib/simple-tree/prepareForInsertion.d.ts +47 -54
  1240. package/lib/simple-tree/prepareForInsertion.d.ts.map +1 -1
  1241. package/lib/simple-tree/prepareForInsertion.js +125 -184
  1242. package/lib/simple-tree/prepareForInsertion.js.map +1 -1
  1243. package/lib/simple-tree/simpleSchema.d.ts.map +1 -1
  1244. package/lib/simple-tree/simpleSchema.js.map +1 -1
  1245. package/lib/simple-tree/treeSchema.d.ts.map +1 -1
  1246. package/lib/simple-tree/treeSchema.js.map +1 -1
  1247. package/lib/simple-tree/unhydratedFlexTreeFromInsertable.d.ts +4 -13
  1248. package/lib/simple-tree/unhydratedFlexTreeFromInsertable.d.ts.map +1 -1
  1249. package/lib/simple-tree/unhydratedFlexTreeFromInsertable.js +13 -30
  1250. package/lib/simple-tree/unhydratedFlexTreeFromInsertable.js.map +1 -1
  1251. package/lib/tableSchema.d.ts.map +1 -1
  1252. package/lib/tableSchema.js +2 -1
  1253. package/lib/tableSchema.js.map +1 -1
  1254. package/lib/text/index.d.ts +1 -0
  1255. package/lib/text/index.d.ts.map +1 -1
  1256. package/lib/text/index.js +1 -0
  1257. package/lib/text/index.js.map +1 -1
  1258. package/lib/text/textDomain.d.ts +8 -0
  1259. package/lib/text/textDomain.d.ts.map +1 -1
  1260. package/lib/text/textDomain.js +1 -1
  1261. package/lib/text/textDomain.js.map +1 -1
  1262. package/lib/text/textDomainFormatted.d.ts +572 -0
  1263. package/lib/text/textDomainFormatted.d.ts.map +1 -0
  1264. package/lib/text/textDomainFormatted.js +180 -0
  1265. package/lib/text/textDomainFormatted.js.map +1 -0
  1266. package/lib/treeFactory.d.ts.map +1 -1
  1267. package/lib/treeFactory.js +4 -14
  1268. package/lib/treeFactory.js.map +1 -1
  1269. package/lib/util/bTreeUtils.d.ts.map +1 -1
  1270. package/lib/util/bTreeUtils.js +1 -1
  1271. package/lib/util/bTreeUtils.js.map +1 -1
  1272. package/lib/util/index.d.ts +1 -1
  1273. package/lib/util/index.d.ts.map +1 -1
  1274. package/lib/util/index.js +1 -1
  1275. package/lib/util/index.js.map +1 -1
  1276. package/lib/util/rangeMap.d.ts +12 -24
  1277. package/lib/util/rangeMap.d.ts.map +1 -1
  1278. package/lib/util/rangeMap.js +5 -44
  1279. package/lib/util/rangeMap.js.map +1 -1
  1280. package/lib/util/readSnapshotBlob.d.ts +1 -1
  1281. package/lib/util/readSnapshotBlob.d.ts.map +1 -1
  1282. package/lib/util/readSnapshotBlob.js.map +1 -1
  1283. package/package.json +22 -22
  1284. package/src/codec/codec.ts +10 -7
  1285. package/src/codec/versioned/codec.ts +3 -3
  1286. package/src/core/change-family/changeFamily.ts +0 -5
  1287. package/src/core/change-family/index.ts +0 -1
  1288. package/src/core/index.ts +1 -4
  1289. package/src/core/rebase/changeRebaser.ts +1 -6
  1290. package/src/core/rebase/index.ts +0 -1
  1291. package/src/core/rebase/types.ts +1 -8
  1292. package/src/core/rebase/utils.ts +7 -31
  1293. package/src/core/schema-stored/formatV2.ts +2 -1
  1294. package/src/core/tree/anchorSet.ts +1 -1
  1295. package/src/core/tree/detachedFieldIndex.ts +2 -18
  1296. package/src/core/tree/detachedFieldIndexCodecCommon.ts +2 -1
  1297. package/src/core/tree/detachedFieldIndexCodecV1.ts +2 -2
  1298. package/src/core/tree/detachedFieldIndexCodecV2.ts +3 -3
  1299. package/src/core/tree/detachedFieldIndexFormatV1.ts +3 -2
  1300. package/src/core/tree/detachedFieldIndexFormatV2.ts +3 -2
  1301. package/src/core/tree/index.ts +1 -2
  1302. package/src/core/tree/pathTree.ts +4 -16
  1303. package/src/core/tree/visitDelta.ts +2 -3
  1304. package/src/core/tree/visitorUtils.ts +2 -1
  1305. package/src/feature-libraries/changeAtomIdBTree.ts +4 -28
  1306. package/src/feature-libraries/chunked-forest/basicChunk.ts +1 -7
  1307. package/src/feature-libraries/chunked-forest/chunkTree.ts +2 -7
  1308. package/src/feature-libraries/chunked-forest/codec/chunkDecoding.ts +1 -1
  1309. package/src/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.ts +1 -1
  1310. package/src/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.ts +1 -1
  1311. package/src/feature-libraries/chunked-forest/codec/codecs.ts +2 -2
  1312. package/src/feature-libraries/chunked-forest/codec/compressedEncode.ts +1 -1
  1313. package/src/feature-libraries/chunked-forest/codec/format.ts +1 -1
  1314. package/src/feature-libraries/chunked-forest/codec/formatGeneric.ts +1 -0
  1315. package/src/feature-libraries/chunked-forest/codec/schemaBasedEncode.ts +3 -3
  1316. package/src/feature-libraries/default-schema/defaultEditBuilder.ts +128 -405
  1317. package/src/feature-libraries/default-schema/defaultFieldKinds.ts +27 -123
  1318. package/src/feature-libraries/default-schema/index.ts +5 -22
  1319. package/src/feature-libraries/default-schema/mappedEditBuilder.ts +9 -35
  1320. package/src/feature-libraries/deltaUtils.ts +1 -6
  1321. package/src/feature-libraries/fieldKindIdentifiers.ts +16 -0
  1322. package/src/feature-libraries/flex-tree/context.ts +0 -17
  1323. package/src/feature-libraries/flex-tree/flexTreeTypes.ts +8 -7
  1324. package/src/feature-libraries/flex-tree/lazyField.ts +26 -69
  1325. package/src/feature-libraries/flex-tree/observer.ts +3 -1
  1326. package/src/feature-libraries/forest-summary/codec.ts +1 -1
  1327. package/src/feature-libraries/forest-summary/forestSummarizer.ts +6 -6
  1328. package/src/feature-libraries/forest-summary/formatV1.ts +1 -0
  1329. package/src/feature-libraries/forest-summary/formatV2.ts +1 -0
  1330. package/src/feature-libraries/forest-summary/incrementalSummaryBuilder.ts +9 -7
  1331. package/src/feature-libraries/forest-summary/summaryTypes.ts +1 -0
  1332. package/src/feature-libraries/index.ts +8 -27
  1333. package/src/feature-libraries/mapTreeCursor.ts +2 -3
  1334. package/src/feature-libraries/mitigatedChangeFamily.ts +1 -3
  1335. package/src/feature-libraries/modular-schema/crossFieldQueries.ts +44 -142
  1336. package/src/feature-libraries/modular-schema/fieldChangeHandler.ts +58 -32
  1337. package/src/feature-libraries/modular-schema/fieldKindConfiguration.ts +1 -0
  1338. package/src/feature-libraries/modular-schema/genericFieldKind.ts +20 -8
  1339. package/src/feature-libraries/modular-schema/index.ts +15 -16
  1340. package/src/feature-libraries/modular-schema/modularChangeCodecV1.ts +336 -543
  1341. package/src/feature-libraries/modular-schema/modularChangeCodecV2.ts +2 -2
  1342. package/src/feature-libraries/modular-schema/modularChangeCodecs.ts +3 -15
  1343. package/src/feature-libraries/modular-schema/modularChangeFamily.ts +753 -2582
  1344. package/src/feature-libraries/modular-schema/modularChangeFormatV1.ts +0 -1
  1345. package/src/feature-libraries/modular-schema/modularChangeTypes.ts +8 -55
  1346. package/src/feature-libraries/object-forest/objectForest.ts +2 -2
  1347. package/src/feature-libraries/optional-field/index.ts +5 -5
  1348. package/src/feature-libraries/optional-field/optionalField.ts +592 -317
  1349. package/src/feature-libraries/optional-field/optionalFieldChangeTypes.ts +38 -24
  1350. package/src/feature-libraries/optional-field/optionalFieldCodecV2.ts +35 -89
  1351. package/src/feature-libraries/optional-field/optionalFieldCodecs.ts +1 -5
  1352. package/src/feature-libraries/optional-field/requiredField.ts +62 -0
  1353. package/src/feature-libraries/schema-edits/schemaChangeCodecs.ts +1 -1
  1354. package/src/feature-libraries/schema-edits/schemaChangeFormat.ts +1 -0
  1355. package/src/feature-libraries/schemaChecker.ts +3 -2
  1356. package/src/feature-libraries/sequence-field/compose.ts +522 -139
  1357. package/src/feature-libraries/sequence-field/helperTypes.ts +19 -34
  1358. package/src/feature-libraries/sequence-field/index.ts +2 -42
  1359. package/src/feature-libraries/sequence-field/invert.ts +228 -103
  1360. package/src/feature-libraries/sequence-field/markQueue.ts +2 -2
  1361. package/src/feature-libraries/sequence-field/moveEffectTable.ts +195 -8
  1362. package/src/feature-libraries/sequence-field/rebase.ts +205 -169
  1363. package/src/feature-libraries/sequence-field/relevantRemovedRoots.ts +57 -0
  1364. package/src/feature-libraries/sequence-field/replaceRevisions.ts +47 -25
  1365. package/src/feature-libraries/sequence-field/sequenceFieldChangeHandler.ts +2 -0
  1366. package/src/feature-libraries/sequence-field/sequenceFieldCodecV2.ts +228 -648
  1367. package/src/feature-libraries/sequence-field/sequenceFieldCodecV3.ts +70 -56
  1368. package/src/feature-libraries/sequence-field/sequenceFieldEditor.ts +27 -25
  1369. package/src/feature-libraries/sequence-field/sequenceFieldToDelta.ts +129 -19
  1370. package/src/feature-libraries/sequence-field/sequenceKind.ts +40 -0
  1371. package/src/feature-libraries/sequence-field/types.ts +64 -34
  1372. package/src/feature-libraries/sequence-field/utils.ts +353 -139
  1373. package/src/index.ts +1 -1
  1374. package/src/packageVersion.ts +1 -1
  1375. package/src/shared-tree/independentView.ts +4 -3
  1376. package/src/shared-tree/index.ts +2 -3
  1377. package/src/shared-tree/schematizeTree.ts +8 -21
  1378. package/src/shared-tree/schematizingTreeView.ts +79 -61
  1379. package/src/shared-tree/sharedTree.ts +10 -64
  1380. package/src/shared-tree/sharedTreeChangeCodecs.ts +2 -5
  1381. package/src/shared-tree/sharedTreeChangeEnricher.ts +87 -68
  1382. package/src/shared-tree/sharedTreeChangeFamily.ts +5 -15
  1383. package/src/shared-tree/sharedTreeEditBuilder.ts +8 -39
  1384. package/src/shared-tree/tree.ts +10 -10
  1385. package/src/shared-tree/treeAlpha.ts +26 -25
  1386. package/src/shared-tree/treeCheckout.ts +119 -94
  1387. package/src/shared-tree-core/branch.ts +6 -12
  1388. package/src/shared-tree-core/branchCommitEnricher.ts +25 -77
  1389. package/src/shared-tree-core/branchIdCodec.ts +1 -0
  1390. package/src/shared-tree-core/changeEnricher.ts +8 -52
  1391. package/src/shared-tree-core/defaultResubmitMachine.ts +39 -51
  1392. package/src/shared-tree-core/editManager.ts +8 -22
  1393. package/src/shared-tree-core/editManagerCodecs.ts +3 -13
  1394. package/src/shared-tree-core/editManagerCodecsCommons.ts +7 -6
  1395. package/src/shared-tree-core/editManagerCodecsV1toV4.ts +1 -1
  1396. package/src/shared-tree-core/editManagerCodecsVSharedBranches.ts +2 -2
  1397. package/src/shared-tree-core/editManagerFormatCommons.ts +1 -6
  1398. package/src/shared-tree-core/editManagerFormatV1toV4.ts +2 -3
  1399. package/src/shared-tree-core/editManagerFormatVSharedBranches.ts +3 -2
  1400. package/src/shared-tree-core/index.ts +2 -7
  1401. package/src/shared-tree-core/messageCodecV1ToV4.ts +4 -5
  1402. package/src/shared-tree-core/messageCodecVSharedBranches.ts +4 -4
  1403. package/src/shared-tree-core/messageCodecs.ts +3 -13
  1404. package/src/shared-tree-core/messageFormat.ts +0 -6
  1405. package/src/shared-tree-core/messageFormatV1ToV4.ts +2 -3
  1406. package/src/shared-tree-core/messageFormatVSharedBranches.ts +1 -0
  1407. package/src/shared-tree-core/messageTypes.ts +1 -0
  1408. package/src/shared-tree-core/sharedTreeCore.ts +27 -31
  1409. package/src/shared-tree-core/versionedSummarizer.ts +3 -1
  1410. package/src/simple-tree/api/configuration.ts +9 -9
  1411. package/src/simple-tree/api/create.ts +7 -6
  1412. package/src/simple-tree/api/dirtyIndex.ts +4 -2
  1413. package/src/simple-tree/api/discrepancies.ts +9 -8
  1414. package/src/simple-tree/api/getJsonSchema.ts +4 -3
  1415. package/src/simple-tree/api/identifierIndex.ts +4 -2
  1416. package/src/simple-tree/api/incrementalAllowedTypes.ts +6 -5
  1417. package/src/simple-tree/api/schemaCompatibilityTester.ts +3 -3
  1418. package/src/simple-tree/api/schemaCreationUtilities.ts +4 -3
  1419. package/src/simple-tree/api/schemaFactory.ts +16 -17
  1420. package/src/simple-tree/api/schemaFactoryAlpha.ts +21 -21
  1421. package/src/simple-tree/api/schemaFactoryBeta.ts +17 -15
  1422. package/src/simple-tree/api/schemaFactoryRecursive.ts +1 -1
  1423. package/src/simple-tree/api/schemaFromSimple.ts +1 -1
  1424. package/src/simple-tree/api/schemaStatics.ts +2 -0
  1425. package/src/simple-tree/api/simpleSchemaCodec.ts +12 -11
  1426. package/src/simple-tree/api/simpleSchemaToJsonSchema.ts +20 -18
  1427. package/src/simple-tree/api/simpleTreeIndex.ts +6 -4
  1428. package/src/simple-tree/api/snapshotCompatibilityChecker.ts +7 -5
  1429. package/src/simple-tree/api/storedSchema.ts +2 -1
  1430. package/src/simple-tree/api/tree.ts +2 -2
  1431. package/src/simple-tree/api/treeBeta.ts +3 -3
  1432. package/src/simple-tree/api/treeNodeApi.ts +14 -13
  1433. package/src/simple-tree/api/typesUnsafe.ts +7 -8
  1434. package/src/simple-tree/api/verboseTree.ts +6 -5
  1435. package/src/simple-tree/core/allowedTypes.ts +4 -4
  1436. package/src/simple-tree/core/context.ts +1 -1
  1437. package/src/simple-tree/core/treeNode.ts +1 -1
  1438. package/src/simple-tree/core/treeNodeKernel.ts +1 -3
  1439. package/src/simple-tree/core/treeNodeSchema.ts +7 -6
  1440. package/src/simple-tree/core/treeNodeValid.ts +9 -9
  1441. package/src/simple-tree/core/unhydratedFlexTree.ts +37 -88
  1442. package/src/simple-tree/core/withType.ts +3 -2
  1443. package/src/simple-tree/createContext.ts +1 -0
  1444. package/src/simple-tree/fieldSchema.ts +5 -8
  1445. package/src/simple-tree/index.ts +1 -2
  1446. package/src/simple-tree/leafNodeSchema.ts +3 -3
  1447. package/src/simple-tree/node-kinds/array/arrayNode.ts +20 -21
  1448. package/src/simple-tree/node-kinds/array/arrayNodeTypes.ts +2 -2
  1449. package/src/simple-tree/node-kinds/common.ts +6 -3
  1450. package/src/simple-tree/node-kinds/map/mapNode.ts +20 -19
  1451. package/src/simple-tree/node-kinds/map/mapNodeTypes.ts +2 -2
  1452. package/src/simple-tree/node-kinds/object/objectNode.ts +37 -37
  1453. package/src/simple-tree/node-kinds/object/objectNodeTypes.ts +8 -7
  1454. package/src/simple-tree/node-kinds/record/recordNode.ts +21 -22
  1455. package/src/simple-tree/node-kinds/record/recordNodeTypes.ts +1 -2
  1456. package/src/simple-tree/prepareForInsertion.ts +205 -345
  1457. package/src/simple-tree/simpleSchema.ts +1 -0
  1458. package/src/simple-tree/treeSchema.ts +1 -0
  1459. package/src/simple-tree/unhydratedFlexTreeFromInsertable.ts +16 -44
  1460. package/src/tableSchema.ts +3 -1
  1461. package/src/text/index.ts +1 -0
  1462. package/src/text/textDomain.ts +1 -1
  1463. package/src/text/textDomainFormatted.ts +309 -0
  1464. package/src/treeFactory.ts +8 -18
  1465. package/src/util/bTreeUtils.ts +1 -1
  1466. package/src/util/index.ts +0 -3
  1467. package/src/util/rangeMap.ts +18 -72
  1468. package/src/util/readSnapshotBlob.ts +4 -2
  1469. package/dist/feature-libraries/default-schema/locationBasedEditBuilder.d.ts +0 -38
  1470. package/dist/feature-libraries/default-schema/locationBasedEditBuilder.d.ts.map +0 -1
  1471. package/dist/feature-libraries/default-schema/locationBasedEditBuilder.js +0 -132
  1472. package/dist/feature-libraries/default-schema/locationBasedEditBuilder.js.map +0 -1
  1473. package/dist/feature-libraries/modular-schema/modularChangeCodecV3.d.ts +0 -15
  1474. package/dist/feature-libraries/modular-schema/modularChangeCodecV3.d.ts.map +0 -1
  1475. package/dist/feature-libraries/modular-schema/modularChangeCodecV3.js +0 -393
  1476. package/dist/feature-libraries/modular-schema/modularChangeCodecV3.js.map +0 -1
  1477. package/dist/feature-libraries/modular-schema/modularChangeFormatV3.d.ts +0 -146
  1478. package/dist/feature-libraries/modular-schema/modularChangeFormatV3.d.ts.map +0 -1
  1479. package/dist/feature-libraries/modular-schema/modularChangeFormatV3.js +0 -32
  1480. package/dist/feature-libraries/modular-schema/modularChangeFormatV3.js.map +0 -1
  1481. package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV3.d.ts +0 -23
  1482. package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV3.d.ts.map +0 -1
  1483. package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV3.js +0 -31
  1484. package/dist/feature-libraries/optional-field/optionalFieldChangeFormatV3.js.map +0 -1
  1485. package/dist/feature-libraries/optional-field/optionalFieldCodecV3.d.ts +0 -12
  1486. package/dist/feature-libraries/optional-field/optionalFieldCodecV3.d.ts.map +0 -1
  1487. package/dist/feature-libraries/optional-field/optionalFieldCodecV3.js +0 -57
  1488. package/dist/feature-libraries/optional-field/optionalFieldCodecV3.js.map +0 -1
  1489. package/dist/shared-tree-core/transactionEnricher.d.ts +0 -23
  1490. package/dist/shared-tree-core/transactionEnricher.d.ts.map +0 -1
  1491. package/dist/shared-tree-core/transactionEnricher.js +0 -74
  1492. package/dist/shared-tree-core/transactionEnricher.js.map +0 -1
  1493. package/lib/feature-libraries/default-schema/locationBasedEditBuilder.d.ts +0 -38
  1494. package/lib/feature-libraries/default-schema/locationBasedEditBuilder.d.ts.map +0 -1
  1495. package/lib/feature-libraries/default-schema/locationBasedEditBuilder.js +0 -128
  1496. package/lib/feature-libraries/default-schema/locationBasedEditBuilder.js.map +0 -1
  1497. package/lib/feature-libraries/modular-schema/modularChangeCodecV3.d.ts +0 -15
  1498. package/lib/feature-libraries/modular-schema/modularChangeCodecV3.d.ts.map +0 -1
  1499. package/lib/feature-libraries/modular-schema/modularChangeCodecV3.js +0 -389
  1500. package/lib/feature-libraries/modular-schema/modularChangeCodecV3.js.map +0 -1
  1501. package/lib/feature-libraries/modular-schema/modularChangeFormatV3.d.ts +0 -146
  1502. package/lib/feature-libraries/modular-schema/modularChangeFormatV3.d.ts.map +0 -1
  1503. package/lib/feature-libraries/modular-schema/modularChangeFormatV3.js +0 -29
  1504. package/lib/feature-libraries/modular-schema/modularChangeFormatV3.js.map +0 -1
  1505. package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV3.d.ts +0 -23
  1506. package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV3.d.ts.map +0 -1
  1507. package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV3.js +0 -27
  1508. package/lib/feature-libraries/optional-field/optionalFieldChangeFormatV3.js.map +0 -1
  1509. package/lib/feature-libraries/optional-field/optionalFieldCodecV3.d.ts +0 -12
  1510. package/lib/feature-libraries/optional-field/optionalFieldCodecV3.d.ts.map +0 -1
  1511. package/lib/feature-libraries/optional-field/optionalFieldCodecV3.js +0 -53
  1512. package/lib/feature-libraries/optional-field/optionalFieldCodecV3.js.map +0 -1
  1513. package/lib/shared-tree-core/transactionEnricher.d.ts +0 -23
  1514. package/lib/shared-tree-core/transactionEnricher.d.ts.map +0 -1
  1515. package/lib/shared-tree-core/transactionEnricher.js +0 -70
  1516. package/lib/shared-tree-core/transactionEnricher.js.map +0 -1
  1517. package/src/feature-libraries/default-schema/locationBasedEditBuilder.ts +0 -188
  1518. package/src/feature-libraries/modular-schema/modularChangeCodecV3.ts +0 -760
  1519. package/src/feature-libraries/modular-schema/modularChangeFormatV3.ts +0 -62
  1520. package/src/feature-libraries/optional-field/optionalFieldChangeFormatV3.ts +0 -45
  1521. package/src/feature-libraries/optional-field/optionalFieldCodecV3.ts +0 -94
  1522. package/src/shared-tree-core/transactionEnricher.ts +0 -74
@@ -7,8 +7,8 @@ import type { TreeChunk } from "../../../core/index.js";
7
7
  import type { BrandedType } from "../../../util/index.js";
8
8
  import { type ChunkDecoder, type StreamCursor } from "./chunkCodecUtilities.js";
9
9
  import type { IdDecodingContext } from "./chunkDecoding.js";
10
- import type { EncodedFieldBatchGeneric, IdentifierOrIndex } from "./formatGeneric.js";
11
10
  import type { IncrementalDecoder } from "./codecs.js";
11
+ import type { EncodedFieldBatchGeneric, IdentifierOrIndex } from "./formatGeneric.js";
12
12
  /**
13
13
  * General purpose shape based tree decoder which gets its support for specific shapes from the caller.
14
14
  */
@@ -1 +1 @@
1
- {"version":3,"file":"chunkDecodingGeneric.d.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,CAAC,SAAS,MAAM,GAAG,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,EAC/D,OAAO,EAAE,iBAAiB,GACxB,CAAC;CAMJ;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,SAAS,MAAM,GAAG,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,EAClF,MAAM,EAAE,YAAY,EACpB,OAAO,EAAE,cAAc,GACrB,CAAC,CAOH"}
1
+ {"version":3,"file":"chunkDecodingGeneric.d.ts","sourceRoot":"","sources":["../../../../src/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,yBAAyB,CAAC;AAC5E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAE1D,OAAO,EACN,KAAK,YAAY,EACjB,KAAK,YAAY,EAGjB,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,KAAK,EAAE,wBAAwB,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAEtF;;GAEG;AACH,wBAAgB,MAAM,CAAC,aAAa,SAAS,MAAM,EAAE,QAAQ,EAC5D,cAAc,EAAE,4BAA4B,CAC3C,aAAa,EACb;IAAC,OAAO,EAAE,QAAQ;CAAC,EACnB,YAAY,CACZ,EACD,OAAO,EAAE,QAAQ,EACjB,KAAK,EAAE,wBAAwB,CAAC,aAAa,CAAC,EAC9C,WAAW,EAAE,YAAY,GACvB,SAAS,EAAE,CAcb;AAED;;GAEG;AACH,qBAAa,cAAc,CAAC,aAAa,GAAG,OAAO;IAEjD;;OAEG;aACa,WAAW,EAAE,SAAS,MAAM,EAAE;aAC9B,MAAM,EAAE,SAAS,aAAa,EAAE;aAChC,iBAAiB,EAAE,iBAAiB;IACpD;;;;OAIG;aACa,kBAAkB,EAAE,kBAAkB,GAAG,SAAS;;IAXlE;;OAEG;IACa,WAAW,EAAE,SAAS,MAAM,EAAE,EAC9B,MAAM,EAAE,SAAS,aAAa,EAAE,EAChC,iBAAiB,EAAE,iBAAiB;IACpD;;;;OAIG;IACa,kBAAkB,EAAE,kBAAkB,GAAG,SAAS;IAG5D,UAAU,CAAC,CAAC,SAAS,MAAM,GAAG,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,EAC/D,OAAO,EAAE,iBAAiB,GACxB,CAAC;CAMJ;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,SAAS,MAAM,GAAG,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,EAClF,MAAM,EAAE,YAAY,EACpB,OAAO,EAAE,cAAc,GACrB,CAAC,CAOH"}
@@ -1 +1 @@
1
- {"version":3,"file":"chunkDecodingGeneric.js","sourceRoot":"","sources":["../../../../src/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;AAM7D,OAAO,EAGN,UAAU,EACV,UAAU,GACV,MAAM,0BAA0B,CAAC;AAKlC;;GAEG;AACH,MAAM,UAAU,MAAM,CACrB,cAIC,EACD,OAAiB,EACjB,KAA8C,EAC9C,WAAyB;IAEzB,MAAM,QAAQ,GAAG,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,cAAc,CAAC,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC;IACtF,MAAM,MAAM,GAAgB,EAAE,CAAC;IAC/B,KAAK,MAAM,KAAK,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC;QAChC,MAAM,MAAM,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC;QAC1C,MAAM,MAAM,GAAG,WAAW,CAAC,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;QACpD,MAAM,CACL,MAAM,CAAC,MAAM,KAAK,MAAM,CAAC,IAAI,CAAC,MAAM,EACpC,KAAK,CAAC,4CAA4C,CAClD,CAAC;QACF,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACrB,CAAC;IAED,OAAO,MAAM,CAAC;AACf,CAAC;AAED;;GAEG;AACH,MAAM,OAAO,cAAc;IAC1B;IACC;;OAEG;IACa,WAA8B,EAC9B,MAAgC,EAChC,iBAAoC;IACpD;;;;OAIG;IACa,kBAAkD;QARlD,gBAAW,GAAX,WAAW,CAAmB;QAC9B,WAAM,GAAN,MAAM,CAA0B;QAChC,sBAAiB,GAAjB,iBAAiB,CAAmB;QAMpC,uBAAkB,GAAlB,kBAAkB,CAAgC;IAChE,CAAC;IAEG,UAAU,CAChB,OAA0B;QAE1B,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE,CAAC;YACjC,OAAO,OAAY,CAAC;QACrB,CAAC;QACD,OAAO,UAAU,CAAC,IAAI,CAAC,WAAW,EAAE,OAAO,CAAM,CAAC;IACnD,CAAC;CACD;AAED;;GAEG;AACH,MAAM,UAAU,oBAAoB,CACnC,MAAoB,EACpB,OAAuB;IAEvB,MAAM,OAAO,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC;IACnC,MAAM,CACL,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,OAAO,KAAK,QAAQ,EAC1D,KAAK,CAAC,sCAAsC,CAC5C,CAAC;IACF,OAAO,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;AACpC,CAAC","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 { DiscriminatedUnionDispatcher } from \"../../../codec/index.js\";\nimport type { TreeChunk } from \"../../../core/index.js\";\nimport type { BrandedType } from \"../../../util/index.js\";\n\nimport {\n\ttype ChunkDecoder,\n\ttype StreamCursor,\n\tgetChecked,\n\treadStream,\n} from \"./chunkCodecUtilities.js\";\nimport type { IdDecodingContext } from \"./chunkDecoding.js\";\nimport type { EncodedFieldBatchGeneric, IdentifierOrIndex } from \"./formatGeneric.js\";\nimport type { IncrementalDecoder } from \"./codecs.js\";\n\n/**\n * General purpose shape based tree decoder which gets its support for specific shapes from the caller.\n */\nexport function decode<TEncodedShape extends object, TContext>(\n\tdecoderLibrary: DiscriminatedUnionDispatcher<\n\t\tTEncodedShape,\n\t\t[context: TContext],\n\t\tChunkDecoder\n\t>,\n\tcontext: TContext,\n\tbatch: EncodedFieldBatchGeneric<TEncodedShape>,\n\trootDecoder: ChunkDecoder,\n): TreeChunk[] {\n\tconst decoders = batch.shapes.map((shape) => decoderLibrary.dispatch(shape, context));\n\tconst chunks: TreeChunk[] = [];\n\tfor (const field of batch.data) {\n\t\tconst stream = { data: field, offset: 0 };\n\t\tconst result = rootDecoder.decode(decoders, stream);\n\t\tassert(\n\t\t\tstream.offset === stream.data.length,\n\t\t\t0x73a /* expected decode to consume full stream */,\n\t\t);\n\t\tchunks.push(result);\n\t}\n\n\treturn chunks;\n}\n\n/**\n * Shared data for use in constructing decoders.\n */\nexport class DecoderContext<TEncodedShape = unknown> {\n\tpublic constructor(\n\t\t/**\n\t\t * Identifier substitution table (use to replace numeric identifier indexes with the actual identifiers from this table).\n\t\t */\n\t\tpublic readonly identifiers: readonly string[],\n\t\tpublic readonly shapes: readonly TEncodedShape[],\n\t\tpublic readonly idDecodingContext: IdDecodingContext,\n\t\t/**\n\t\t * To be used to decode incremental chunks, if any.\n\t\t * @remarks\n\t\t * See {@link IncrementalDecoder} for more information.\n\t\t */\n\t\tpublic readonly incrementalDecoder: IncrementalDecoder | undefined,\n\t) {}\n\n\tpublic identifier<T extends string & BrandedType<string, string>>(\n\t\tencoded: IdentifierOrIndex,\n\t): T {\n\t\tif (typeof encoded === \"string\") {\n\t\t\treturn encoded as T;\n\t\t}\n\t\treturn getChecked(this.identifiers, encoded) as T;\n\t}\n}\n\n/**\n * Read one identifier from the stream, advancing the stream offset.\n */\nexport function readStreamIdentifier<T extends string & BrandedType<string, string>>(\n\tstream: StreamCursor,\n\tcontext: DecoderContext,\n): T {\n\tconst content = readStream(stream);\n\tassert(\n\t\ttypeof content === \"number\" || typeof content === \"string\",\n\t\t0x73b /* content to be a number or string */,\n\t);\n\treturn context.identifier(content);\n}\n"]}
1
+ {"version":3,"file":"chunkDecodingGeneric.js","sourceRoot":"","sources":["../../../../src/feature-libraries/chunked-forest/codec/chunkDecodingGeneric.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;AAM7D,OAAO,EAGN,UAAU,EACV,UAAU,GACV,MAAM,0BAA0B,CAAC;AAKlC;;GAEG;AACH,MAAM,UAAU,MAAM,CACrB,cAIC,EACD,OAAiB,EACjB,KAA8C,EAC9C,WAAyB;IAEzB,MAAM,QAAQ,GAAG,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,cAAc,CAAC,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC;IACtF,MAAM,MAAM,GAAgB,EAAE,CAAC;IAC/B,KAAK,MAAM,KAAK,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC;QAChC,MAAM,MAAM,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC;QAC1C,MAAM,MAAM,GAAG,WAAW,CAAC,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;QACpD,MAAM,CACL,MAAM,CAAC,MAAM,KAAK,MAAM,CAAC,IAAI,CAAC,MAAM,EACpC,KAAK,CAAC,4CAA4C,CAClD,CAAC;QACF,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACrB,CAAC;IAED,OAAO,MAAM,CAAC;AACf,CAAC;AAED;;GAEG;AACH,MAAM,OAAO,cAAc;IAC1B;IACC;;OAEG;IACa,WAA8B,EAC9B,MAAgC,EAChC,iBAAoC;IACpD;;;;OAIG;IACa,kBAAkD;QARlD,gBAAW,GAAX,WAAW,CAAmB;QAC9B,WAAM,GAAN,MAAM,CAA0B;QAChC,sBAAiB,GAAjB,iBAAiB,CAAmB;QAMpC,uBAAkB,GAAlB,kBAAkB,CAAgC;IAChE,CAAC;IAEG,UAAU,CAChB,OAA0B;QAE1B,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE,CAAC;YACjC,OAAO,OAAY,CAAC;QACrB,CAAC;QACD,OAAO,UAAU,CAAC,IAAI,CAAC,WAAW,EAAE,OAAO,CAAM,CAAC;IACnD,CAAC;CACD;AAED;;GAEG;AACH,MAAM,UAAU,oBAAoB,CACnC,MAAoB,EACpB,OAAuB;IAEvB,MAAM,OAAO,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC;IACnC,MAAM,CACL,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,OAAO,KAAK,QAAQ,EAC1D,KAAK,CAAC,sCAAsC,CAC5C,CAAC;IACF,OAAO,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;AACpC,CAAC","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 { DiscriminatedUnionDispatcher } from \"../../../codec/index.js\";\nimport type { TreeChunk } from \"../../../core/index.js\";\nimport type { BrandedType } from \"../../../util/index.js\";\n\nimport {\n\ttype ChunkDecoder,\n\ttype StreamCursor,\n\tgetChecked,\n\treadStream,\n} from \"./chunkCodecUtilities.js\";\nimport type { IdDecodingContext } from \"./chunkDecoding.js\";\nimport type { IncrementalDecoder } from \"./codecs.js\";\nimport type { EncodedFieldBatchGeneric, IdentifierOrIndex } from \"./formatGeneric.js\";\n\n/**\n * General purpose shape based tree decoder which gets its support for specific shapes from the caller.\n */\nexport function decode<TEncodedShape extends object, TContext>(\n\tdecoderLibrary: DiscriminatedUnionDispatcher<\n\t\tTEncodedShape,\n\t\t[context: TContext],\n\t\tChunkDecoder\n\t>,\n\tcontext: TContext,\n\tbatch: EncodedFieldBatchGeneric<TEncodedShape>,\n\trootDecoder: ChunkDecoder,\n): TreeChunk[] {\n\tconst decoders = batch.shapes.map((shape) => decoderLibrary.dispatch(shape, context));\n\tconst chunks: TreeChunk[] = [];\n\tfor (const field of batch.data) {\n\t\tconst stream = { data: field, offset: 0 };\n\t\tconst result = rootDecoder.decode(decoders, stream);\n\t\tassert(\n\t\t\tstream.offset === stream.data.length,\n\t\t\t0x73a /* expected decode to consume full stream */,\n\t\t);\n\t\tchunks.push(result);\n\t}\n\n\treturn chunks;\n}\n\n/**\n * Shared data for use in constructing decoders.\n */\nexport class DecoderContext<TEncodedShape = unknown> {\n\tpublic constructor(\n\t\t/**\n\t\t * Identifier substitution table (use to replace numeric identifier indexes with the actual identifiers from this table).\n\t\t */\n\t\tpublic readonly identifiers: readonly string[],\n\t\tpublic readonly shapes: readonly TEncodedShape[],\n\t\tpublic readonly idDecodingContext: IdDecodingContext,\n\t\t/**\n\t\t * To be used to decode incremental chunks, if any.\n\t\t * @remarks\n\t\t * See {@link IncrementalDecoder} for more information.\n\t\t */\n\t\tpublic readonly incrementalDecoder: IncrementalDecoder | undefined,\n\t) {}\n\n\tpublic identifier<T extends string & BrandedType<string, string>>(\n\t\tencoded: IdentifierOrIndex,\n\t): T {\n\t\tif (typeof encoded === \"string\") {\n\t\t\treturn encoded as T;\n\t\t}\n\t\treturn getChecked(this.identifiers, encoded) as T;\n\t}\n}\n\n/**\n * Read one identifier from the stream, advancing the stream offset.\n */\nexport function readStreamIdentifier<T extends string & BrandedType<string, string>>(\n\tstream: StreamCursor,\n\tcontext: DecoderContext,\n): T {\n\tconst content = readStream(stream);\n\tassert(\n\t\ttypeof content === \"number\" || typeof content === \"string\",\n\t\t0x73b /* content to be a number or string */,\n\t);\n\treturn context.identifier(content);\n}\n"]}
@@ -4,8 +4,8 @@
4
4
  */
5
5
  import type { FluidSerializableReadOnly } from "../../valueUtilities.js";
6
6
  import { Counter, type CounterFilter, type DeduplicationTable } from "./chunkCodecUtilities.js";
7
- import type { EncodedFieldBatchGeneric } from "./formatGeneric.js";
8
7
  import type { FieldBatchFormatVersion } from "./format.js";
8
+ import type { EncodedFieldBatchGeneric } from "./formatGeneric.js";
9
9
  /**
10
10
  * An identifier which can be compressed using {@link Counter}.
11
11
  *
@@ -1 +1 @@
1
- {"version":3,"file":"chunkEncodingGeneric.d.ts","sourceRoot":"","sources":["../../../../src/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAC;AAEzE,OAAO,EACN,OAAO,EACP,KAAK,aAAa,EAClB,KAAK,kBAAkB,EAEvB,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AACnE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AAE3D;;;;;;;;GAQG;AACH,qBAAa,eAAe;aACQ,UAAU,EAAE,MAAM;gBAAlB,UAAU,EAAE,MAAM;CACrD;AAED;;;;;GAKG;AACH,MAAM,MAAM,YAAY,CAAC,aAAa,IAAI,CACvC,yBAAyB,GACzB,KAAK,CAAC,aAAa,CAAC,GACpB,eAAe,GACf,YAAY,CAAC,aAAa,CAAC,CAC7B,EAAE,CAAC;AAEJ;;;;;;;GAOG;AACH,wBAAgB,kCAAkC,CAAC,aAAa,EAC/D,OAAO,EAAE,uBAAuB,EAChC,MAAM,EAAE,YAAY,CAAC,aAAa,CAAC,EAAE,EACrC,gBAAgB,GAAE,aAAa,CAAC,MAAM,CAAwB,GAC5D,wBAAwB,CAAC,aAAa,CAAC,CA2EzC;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,8BAAsB,KAAK,CAAC,aAAa;IACxC;;;;;;;;;;OAUG;aACa,mCAAmC,CAClD,WAAW,EAAE,OAAO,CAAC,MAAM,CAAC,EAC5B,eAAe,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,aAAa,CAAC,KAAK,IAAI,GACpD,IAAI;IAEP;;;;;;;OAOG;aACa,WAAW,CAC1B,WAAW,EAAE,kBAAkB,CAAC,MAAM,CAAC,EACvC,MAAM,EAAE,kBAAkB,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,GAC9C,aAAa;CAChB"}
1
+ {"version":3,"file":"chunkEncodingGeneric.d.ts","sourceRoot":"","sources":["../../../../src/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAC;AAEzE,OAAO,EACN,OAAO,EACP,KAAK,aAAa,EAClB,KAAK,kBAAkB,EAEvB,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AAC3D,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AAEnE;;;;;;;;GAQG;AACH,qBAAa,eAAe;aACQ,UAAU,EAAE,MAAM;gBAAlB,UAAU,EAAE,MAAM;CACrD;AAED;;;;;GAKG;AACH,MAAM,MAAM,YAAY,CAAC,aAAa,IAAI,CACvC,yBAAyB,GACzB,KAAK,CAAC,aAAa,CAAC,GACpB,eAAe,GACf,YAAY,CAAC,aAAa,CAAC,CAC7B,EAAE,CAAC;AAEJ;;;;;;;GAOG;AACH,wBAAgB,kCAAkC,CAAC,aAAa,EAC/D,OAAO,EAAE,uBAAuB,EAChC,MAAM,EAAE,YAAY,CAAC,aAAa,CAAC,EAAE,EACrC,gBAAgB,GAAE,aAAa,CAAC,MAAM,CAAwB,GAC5D,wBAAwB,CAAC,aAAa,CAAC,CA2EzC;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,8BAAsB,KAAK,CAAC,aAAa;IACxC;;;;;;;;;;OAUG;aACa,mCAAmC,CAClD,WAAW,EAAE,OAAO,CAAC,MAAM,CAAC,EAC5B,eAAe,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,aAAa,CAAC,KAAK,IAAI,GACpD,IAAI;IAEP;;;;;;;OAOG;aACa,WAAW,CAC1B,WAAW,EAAE,kBAAkB,CAAC,MAAM,CAAC,EACvC,MAAM,EAAE,kBAAkB,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,GAC9C,aAAa;CAChB"}
@@ -1 +1 @@
1
- {"version":3,"file":"chunkEncodingGeneric.js","sourceRoot":"","sources":["../../../../src/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,qCAAqC,CAAC;AAK3D,OAAO,EACN,OAAO,EAGP,oBAAoB,GACpB,MAAM,0BAA0B,CAAC;AAIlC;;;;;;;;GAQG;AACH,MAAM,OAAO,eAAe;IAC3B,YAAmC,UAAkB;QAAlB,eAAU,GAAV,UAAU,CAAQ;IAAG,CAAC;CACzD;AAeD;;;;;;;GAOG;AACH,MAAM,UAAU,kCAAkC,CACjD,OAAgC,EAChC,MAAqC,EACrC,mBAA0C,oBAAoB;IAE9D,MAAM,WAAW,GAAG,IAAI,OAAO,EAAU,CAAC;IAC1C,MAAM,MAAM,GAAG,IAAI,OAAO,EAAwB,CAAC;IACnD,+FAA+F;IAC/F,iCAAiC;IACjC,MAAM,UAAU,GAAG,IAAI,GAAG,EAAwB,CAAC;IACnD,MAAM,YAAY,GAA2B,EAAE,CAAC;IAChD,MAAM,eAAe,GAAG,CAAC,KAA2B,EAAQ,EAAE;QAC7D,MAAM,CAAC,GAAG,CAAC,KAAK,CA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,eAAe,GAAG,WAAW,CAAC,UAAU,CAAC,gBAAgB,CAAC,CAAC;IACjE,MAAM,UAAU,GAAG,MAAM,CAAC,UAAU,EAAE,CAAC;IAEvC,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC5B,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,KAAK,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,CAAC;YACnD,MAAM,IAAI,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC;YAC1B,IAAI,IAAI,YAAY,eAAe,EAAE,CAAC;gBACrC,KAAK,CAAC,KAAK,CAAC,GAAG,eAAe,CAAC,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,IAAI,CAAC,UAAU,CAAC;YACrF,CAAC;iBAAM,IAAI,IAAI,YAAY,KAAK,EAAE,CAAC;gBAClC,KAAK,CAAC,KAAK,CAAC,GAAG,UAAU,CAAC,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAC;YACrF,CAAC;QACF,CAAC;IACF,CAAC;IAED,MAAM,aAAa,GAAG,UAAU,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAC3D,KAAK,CAAC,WAAW,CAAC,eAAe,EAAE,UAAU,CAAC,CAC9C,CAAC;IAEF,OAAO;QACN,OAAO;QACP,wDAAwD;QACxD,WAAW,EAAE,eAAe,CAAC,YAAwB;QACrD,MAAM,EAAE,aAAa;QACrB,IAAI,EAAE,MAAuB;KAC7B,CAAC;AACH,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,OAAgB,KAAK;CA6B1B","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { fail } from \"@fluidframework/core-utils/internal\";\n\nimport type { TreeValue } from \"../../../core/index.js\";\nimport type { FluidSerializableReadOnly } from \"../../valueUtilities.js\";\n\nimport {\n\tCounter,\n\ttype CounterFilter,\n\ttype DeduplicationTable,\n\tjsonMinimizingFilter,\n} from \"./chunkCodecUtilities.js\";\nimport type { EncodedFieldBatchGeneric } from \"./formatGeneric.js\";\nimport type { FieldBatchFormatVersion } from \"./format.js\";\n\n/**\n * An identifier which can be compressed using {@link Counter}.\n *\n * @remarks\n * Compression of Identifiers is done after the output is otherwise generated to enable counting all the usages.\n * To avoid having to decode the decode the data array to determine which data is an identifier and which is some other string,\n * some recognizable representation is required.\n * Using a class and checking its prototype works for this, and is why IdentifierToken is a class.\n */\nexport class IdentifierToken {\n\tpublic constructor(public readonly identifier: string) {}\n}\n\n/**\n * Format for data emitted during encoding, before dictionary compression of identifiers.\n *\n * @remarks\n * These buffers are mutated after construction if they contain identifiers or shapes.\n */\nexport type BufferFormat<TEncodedShape> = (\n\t| FluidSerializableReadOnly\n\t| Shape<TEncodedShape>\n\t| IdentifierToken\n\t| BufferFormat<TEncodedShape>\n)[];\n\n/**\n * Takes already encoded content in `buffer` and deeply searches, replacing each `IdentifierToken` and `Shape`\n * with references to their encodings in the returned `EncodedFieldBatchGeneric`.\n *\n * This looks inside nested arrays (including transitively) but not inside objects.\n *\n * Note that this modifies `buffer` to avoid having to copy it.\n */\nexport function updateShapesAndIdentifiersEncoding<TEncodedShape>(\n\tversion: FieldBatchFormatVersion,\n\tbuffer: BufferFormat<TEncodedShape>[],\n\tidentifierFilter: CounterFilter<string> = jsonMinimizingFilter,\n): EncodedFieldBatchGeneric<TEncodedShape> {\n\tconst identifiers = new Counter<string>();\n\tconst shapes = new Counter<Shape<TEncodedShape>>();\n\t// Shapes can reference other shapes (and identifiers), so we need to traverse the shape graph.\n\t// These collections enable that.\n\tconst shapesSeen = new Set<Shape<TEncodedShape>>();\n\tconst shapeToCount: Shape<TEncodedShape>[] = [];\n\tconst shapeDiscovered = (shape: Shape<TEncodedShape>): void => {\n\t\tshapes.add(shape);\n\t\tif (!shapesSeen.has(shape)) {\n\t\t\tshapesSeen.add(shape);\n\t\t\tshapeToCount.push(shape);\n\t\t}\n\t};\n\n\t// A collection of all arrays transitively reachable (via arrays) from buffer.\n\t// These are all the arrays whose contents are searched for shapes and identifiers which are then replaced\n\t// with references. This uses a breadth first traversal, but the actual order is not important.\n\tconst arrays: BufferFormat<TEncodedShape>[] = [buffer];\n\tfor (const array of arrays) {\n\t\tfor (const item of array) {\n\t\t\tif (item instanceof IdentifierToken) {\n\t\t\t\tidentifiers.add(item.identifier);\n\t\t\t} else if (item instanceof Shape) {\n\t\t\t\tshapeDiscovered(item);\n\t\t\t} else if (Array.isArray(item)) {\n\t\t\t\t// In JS it is legal to push items to an array which is being iterated,\n\t\t\t\t// and they will be visited in order.\n\t\t\t\tarrays.push(item);\n\t\t\t} else if (\n\t\t\t\titem !== null &&\n\t\t\t\ttypeof item === \"object\" &&\n\t\t\t\t(item as Record<string, unknown>).shape instanceof Shape\n\t\t\t) {\n\t\t\t\t// because \"serializable\" is allowed in buffer and it has type `any`, its very easy to mess up including of shapes in the buffer.\n\t\t\t\t// This catches the easiest way to get it wrong.\n\t\t\t\tfail(0xb4b /* encoder interface instead of shape written to stream */);\n\t\t\t}\n\t\t}\n\t}\n\n\t// Traverse shape graph, discovering and counting all shape to shape and shape to identifier references.\n\t{\n\t\tlet shape: Shape<TEncodedShape> | undefined;\n\t\twhile ((shape = shapeToCount.pop()) !== undefined) {\n\t\t\tshape.countReferencedShapesAndIdentifiers(identifiers, shapeDiscovered);\n\t\t}\n\t}\n\n\t// Determine substitutions for identifiers and shapes:\n\tconst identifierTable = identifiers.buildTable(identifierFilter);\n\tconst shapeTable = shapes.buildTable();\n\n\tfor (const array of arrays) {\n\t\tfor (let index = 0; index < array.length; index++) {\n\t\t\tconst item = array[index];\n\t\t\tif (item instanceof IdentifierToken) {\n\t\t\t\tarray[index] = identifierTable.valueToIndex.get(item.identifier) ?? item.identifier;\n\t\t\t} else if (item instanceof Shape) {\n\t\t\t\tarray[index] = shapeTable.valueToIndex.get(item) ?? fail(0xb4c /* missing shape */);\n\t\t\t}\n\t\t}\n\t}\n\n\tconst encodedShapes = shapeTable.indexToValue.map((shape) =>\n\t\tshape.encodeShape(identifierTable, shapeTable),\n\t);\n\n\treturn {\n\t\tversion,\n\t\t// TODO: fix readonly typing issues to remove this cast.\n\t\tidentifiers: identifierTable.indexToValue as string[],\n\t\tshapes: encodedShapes,\n\t\tdata: buffer as TreeValue[][],\n\t};\n}\n\n/**\n * A tree shape.\n * This similar to a schema for a tree, though it may be more or less specific than the actual schema system used.\n * Can be encoded into a `TEncodedShape`: when doing so encodes references to shapes (if needed) using {@link Counter}:\n * this can include recursive references (direct or indirect).\n *\n * @remarks\n * Deduplication of shapes is done after the output is otherwise generated (including identifier dictionary encoding).\n * To avoid having to decode the data array to determine which data is a shape and which is some other object,\n * some recognizable representation is required.\n * Using a class and checking its prototype works for this, and is why Shape is a class.\n *\n * Note that deduplication compares shapes by object identity not by content, so encoders must ensure shapes are not duplicated to achieve efficient encoding.\n * Comparison by content would be difficult due to shape containing references to other shapes.\n *\n * @privateRemarks\n * Unlike with identifiers, conversion from the initial form (this class / IdentifierToken) is done by the `encodeShape` method, not by general purpose logic in `updateShapesAndIdentifiersEncoding`.\n * For `updateShapesAndIdentifiersEncoding` to do the conversion without help from `encodeShape`,\n * instances of this Shape class would have to either be or output an object that is identical to the `TEncodedShape` format except with all shape references as object references instead of indexes.\n * Those objects would have to be deeply traversed looking for shape objects to replace with reference indexes.\n * This is possible, but making it type safe would involve generating derived types from the `TEncodedShape` deeply replacing any shape references, as well as requiring deep traversal of all objects in the encoded output.\n * Such an approach seemed less maintainable and readable than the design taken here which avoids the need for those derived types.\n */\nexport abstract class Shape<TEncodedShape> {\n\t/**\n\t * Enumerate all contents of this shape that can get replaced with references (for better compression/deduplication) during encoding.\n\t * This currently includes shapes and identifiers.\n\t *\n\t * Used to discover referenced shapes (to ensure they are included in the `shapes` passed to `encodeShape`),\n\t * as well as count usages of shapes and identifiers for more efficient dictionary encoding. See {@link Counter}.\n\t *\n\t * @param shapeDiscovered - must be invoked with each directly referenced shape (which must be provided to `encodeShape`).\n\t * Can be invoked multiple times if a shape is referenced more than once for more efficient dictionary encoding.\n\t * Should not be invoked with `this` unless this shape references itself.\n\t */\n\tpublic abstract countReferencedShapesAndIdentifiers(\n\t\tidentifiers: Counter<string>,\n\t\tshapeDiscovered: (shape: Shape<TEncodedShape>) => void,\n\t): void;\n\n\t/**\n\t * Produce the final encoded format for this shape.\n\t *\n\t * @param identifiers - a subset of identifiers used in this tree, and their corresponding indexes to use for the dictionary encoding.\n\t * Can be used to encode identifiers referenced by this shape.\n\t * @param shapes - includes a superset of shapes reported by count.\n\t * Used to encode references to shapes as numbers.\n\t */\n\tpublic abstract encodeShape(\n\t\tidentifiers: DeduplicationTable<string>,\n\t\tshapes: DeduplicationTable<Shape<TEncodedShape>>,\n\t): TEncodedShape;\n}\n"]}
1
+ {"version":3,"file":"chunkEncodingGeneric.js","sourceRoot":"","sources":["../../../../src/feature-libraries/chunked-forest/codec/chunkEncodingGeneric.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,qCAAqC,CAAC;AAK3D,OAAO,EACN,OAAO,EAGP,oBAAoB,GACpB,MAAM,0BAA0B,CAAC;AAIlC;;;;;;;;GAQG;AACH,MAAM,OAAO,eAAe;IAC3B,YAAmC,UAAkB;QAAlB,eAAU,GAAV,UAAU,CAAQ;IAAG,CAAC;CACzD;AAeD;;;;;;;GAOG;AACH,MAAM,UAAU,kCAAkC,CACjD,OAAgC,EAChC,MAAqC,EACrC,mBAA0C,oBAAoB;IAE9D,MAAM,WAAW,GAAG,IAAI,OAAO,EAAU,CAAC;IAC1C,MAAM,MAAM,GAAG,IAAI,OAAO,EAAwB,CAAC;IACnD,+FAA+F;IAC/F,iCAAiC;IACjC,MAAM,UAAU,GAAG,IAAI,GAAG,EAAwB,CAAC;IACnD,MAAM,YAAY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ributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { fail } from \"@fluidframework/core-utils/internal\";\n\nimport type { TreeValue } from \"../../../core/index.js\";\nimport type { FluidSerializableReadOnly } from \"../../valueUtilities.js\";\n\nimport {\n\tCounter,\n\ttype CounterFilter,\n\ttype DeduplicationTable,\n\tjsonMinimizingFilter,\n} from \"./chunkCodecUtilities.js\";\nimport type { FieldBatchFormatVersion } from \"./format.js\";\nimport type { EncodedFieldBatchGeneric } from \"./formatGeneric.js\";\n\n/**\n * An identifier which can be compressed using {@link Counter}.\n *\n * @remarks\n * Compression of Identifiers is done after the output is otherwise generated to enable counting all the usages.\n * To avoid having to decode the decode the data array to determine which data is an identifier and which is some other string,\n * some recognizable representation is required.\n * Using a class and checking its prototype works for this, and is why IdentifierToken is a class.\n */\nexport class IdentifierToken {\n\tpublic constructor(public readonly identifier: string) {}\n}\n\n/**\n * Format for data emitted during encoding, before dictionary compression of identifiers.\n *\n * @remarks\n * These buffers are mutated after construction if they contain identifiers or shapes.\n */\nexport type BufferFormat<TEncodedShape> = (\n\t| FluidSerializableReadOnly\n\t| Shape<TEncodedShape>\n\t| IdentifierToken\n\t| BufferFormat<TEncodedShape>\n)[];\n\n/**\n * Takes already encoded content in `buffer` and deeply searches, replacing each `IdentifierToken` and `Shape`\n * with references to their encodings in the returned `EncodedFieldBatchGeneric`.\n *\n * This looks inside nested arrays (including transitively) but not inside objects.\n *\n * Note that this modifies `buffer` to avoid having to copy it.\n */\nexport function updateShapesAndIdentifiersEncoding<TEncodedShape>(\n\tversion: FieldBatchFormatVersion,\n\tbuffer: BufferFormat<TEncodedShape>[],\n\tidentifierFilter: CounterFilter<string> = jsonMinimizingFilter,\n): EncodedFieldBatchGeneric<TEncodedShape> {\n\tconst identifiers = new Counter<string>();\n\tconst shapes = new Counter<Shape<TEncodedShape>>();\n\t// Shapes can reference other shapes (and identifiers), so we need to traverse the shape graph.\n\t// These collections enable that.\n\tconst shapesSeen = new Set<Shape<TEncodedShape>>();\n\tconst shapeToCount: Shape<TEncodedShape>[] = [];\n\tconst shapeDiscovered = (shape: Shape<TEncodedShape>): void => {\n\t\tshapes.add(shape);\n\t\tif (!shapesSeen.has(shape)) {\n\t\t\tshapesSeen.add(shape);\n\t\t\tshapeToCount.push(shape);\n\t\t}\n\t};\n\n\t// A collection of all arrays transitively reachable (via arrays) from buffer.\n\t// These are all the arrays whose contents are searched for shapes and identifiers which are then replaced\n\t// with references. This uses a breadth first traversal, but the actual order is not important.\n\tconst arrays: BufferFormat<TEncodedShape>[] = [buffer];\n\tfor (const array of arrays) {\n\t\tfor (const item of array) {\n\t\t\tif (item instanceof IdentifierToken) {\n\t\t\t\tidentifiers.add(item.identifier);\n\t\t\t} else if (item instanceof Shape) {\n\t\t\t\tshapeDiscovered(item);\n\t\t\t} else if (Array.isArray(item)) {\n\t\t\t\t// In JS it is legal to push items to an array which is being iterated,\n\t\t\t\t// and they will be visited in order.\n\t\t\t\tarrays.push(item);\n\t\t\t} else if (\n\t\t\t\titem !== null &&\n\t\t\t\ttypeof item === \"object\" &&\n\t\t\t\t(item as Record<string, unknown>).shape instanceof Shape\n\t\t\t) {\n\t\t\t\t// because \"serializable\" is allowed in buffer and it has type `any`, its very easy to mess up including of shapes in the buffer.\n\t\t\t\t// This catches the easiest way to get it wrong.\n\t\t\t\tfail(0xb4b /* encoder interface instead of shape written to stream */);\n\t\t\t}\n\t\t}\n\t}\n\n\t// Traverse shape graph, discovering and counting all shape to shape and shape to identifier references.\n\t{\n\t\tlet shape: Shape<TEncodedShape> | undefined;\n\t\twhile ((shape = shapeToCount.pop()) !== undefined) {\n\t\t\tshape.countReferencedShapesAndIdentifiers(identifiers, shapeDiscovered);\n\t\t}\n\t}\n\n\t// Determine substitutions for identifiers and shapes:\n\tconst identifierTable = identifiers.buildTable(identifierFilter);\n\tconst shapeTable = shapes.buildTable();\n\n\tfor (const array of arrays) {\n\t\tfor (let index = 0; index < array.length; index++) {\n\t\t\tconst item = array[index];\n\t\t\tif (item instanceof IdentifierToken) {\n\t\t\t\tarray[index] = identifierTable.valueToIndex.get(item.identifier) ?? item.identifier;\n\t\t\t} else if (item instanceof Shape) {\n\t\t\t\tarray[index] = shapeTable.valueToIndex.get(item) ?? fail(0xb4c /* missing shape */);\n\t\t\t}\n\t\t}\n\t}\n\n\tconst encodedShapes = shapeTable.indexToValue.map((shape) =>\n\t\tshape.encodeShape(identifierTable, shapeTable),\n\t);\n\n\treturn {\n\t\tversion,\n\t\t// TODO: fix readonly typing issues to remove this cast.\n\t\tidentifiers: identifierTable.indexToValue as string[],\n\t\tshapes: encodedShapes,\n\t\tdata: buffer as TreeValue[][],\n\t};\n}\n\n/**\n * A tree shape.\n * This similar to a schema for a tree, though it may be more or less specific than the actual schema system used.\n * Can be encoded into a `TEncodedShape`: when doing so encodes references to shapes (if needed) using {@link Counter}:\n * this can include recursive references (direct or indirect).\n *\n * @remarks\n * Deduplication of shapes is done after the output is otherwise generated (including identifier dictionary encoding).\n * To avoid having to decode the data array to determine which data is a shape and which is some other object,\n * some recognizable representation is required.\n * Using a class and checking its prototype works for this, and is why Shape is a class.\n *\n * Note that deduplication compares shapes by object identity not by content, so encoders must ensure shapes are not duplicated to achieve efficient encoding.\n * Comparison by content would be difficult due to shape containing references to other shapes.\n *\n * @privateRemarks\n * Unlike with identifiers, conversion from the initial form (this class / IdentifierToken) is done by the `encodeShape` method, not by general purpose logic in `updateShapesAndIdentifiersEncoding`.\n * For `updateShapesAndIdentifiersEncoding` to do the conversion without help from `encodeShape`,\n * instances of this Shape class would have to either be or output an object that is identical to the `TEncodedShape` format except with all shape references as object references instead of indexes.\n * Those objects would have to be deeply traversed looking for shape objects to replace with reference indexes.\n * This is possible, but making it type safe would involve generating derived types from the `TEncodedShape` deeply replacing any shape references, as well as requiring deep traversal of all objects in the encoded output.\n * Such an approach seemed less maintainable and readable than the design taken here which avoids the need for those derived types.\n */\nexport abstract class Shape<TEncodedShape> {\n\t/**\n\t * Enumerate all contents of this shape that can get replaced with references (for better compression/deduplication) during encoding.\n\t * This currently includes shapes and identifiers.\n\t *\n\t * Used to discover referenced shapes (to ensure they are included in the `shapes` passed to `encodeShape`),\n\t * as well as count usages of shapes and identifiers for more efficient dictionary encoding. See {@link Counter}.\n\t *\n\t * @param shapeDiscovered - must be invoked with each directly referenced shape (which must be provided to `encodeShape`).\n\t * Can be invoked multiple times if a shape is referenced more than once for more efficient dictionary encoding.\n\t * Should not be invoked with `this` unless this shape references itself.\n\t */\n\tpublic abstract countReferencedShapesAndIdentifiers(\n\t\tidentifiers: Counter<string>,\n\t\tshapeDiscovered: (shape: Shape<TEncodedShape>) => void,\n\t): void;\n\n\t/**\n\t * Produce the final encoded format for this shape.\n\t *\n\t * @param identifiers - a subset of identifiers used in this tree, and their corresponding indexes to use for the dictionary encoding.\n\t * Can be used to encode identifiers referenced by this shape.\n\t * @param shapes - includes a superset of shapes reported by count.\n\t * Used to encode references to shapes as numbers.\n\t */\n\tpublic abstract encodeShape(\n\t\tidentifiers: DeduplicationTable<string>,\n\t\tshapes: DeduplicationTable<Shape<TEncodedShape>>,\n\t): TEncodedShape;\n}\n"]}
@@ -3,13 +3,13 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
  import type { IIdCompressor, SessionId } from "@fluidframework/id-compressor";
6
+ import type { MinimumVersionForCollab } from "@fluidframework/runtime-definitions/internal";
6
7
  import { type CodecTree, type CodecWriteOptions, type IJsonCodec } from "../../../codec/index.js";
7
8
  import { type ITreeCursorSynchronous, type SchemaAndPolicy, type TreeChunk } from "../../../core/index.js";
8
9
  import { type Brand, type JsonCompatibleReadOnly } from "../../../util/index.js";
9
10
  import { TreeCompressionStrategy } from "../../treeCompressionUtils.js";
10
11
  import type { FieldBatch } from "./fieldBatch.js";
11
12
  import { type EncodedFieldBatch } from "./format.js";
12
- import type { MinimumVersionForCollab } from "@fluidframework/runtime-definitions/internal";
13
13
  import type { IncrementalEncodingPolicy } from "./incrementalEncodingPolicy.js";
14
14
  /**
15
15
  * Reference ID for a chunk that is incrementally encoded.
@@ -1 +1 @@
1
- {"version":3,"file":"codecs.d.ts","sourceRoot":"","sources":["../../../../src/feature-libraries/chunked-forest/codec/codecs.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAM9E,OAAO,EACN,KAAK,SAAS,EACd,KAAK,iBAAiB,EAEtB,KAAK,UAAU,EAEf,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAEN,KAAK,sBAAsB,EAC3B,KAAK,eAAe,EACpB,KAAK,SAAS,EACd,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAGN,KAAK,KAAK,EACV,KAAK,sBAAsB,EAE3B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AAGxE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EACN,KAAK,iBAAiB,EAKtB,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,8CAA8C,CAAC;AAC5F,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAIhF;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,KAAK,CAAC,MAAM,EAAE,yBAAyB,CAAC,CAAC;AAGxE;;;;;;;;GAQG;AACH,MAAM,WAAW,kBAAkB;IAClC;;;OAGG;IACH,yBAAyB,EAAE,yBAAyB,CAAC;IACrD;;;;;;;OAOG;IACH,sBAAsB,CACrB,MAAM,EAAE,sBAAsB,EAC9B,YAAY,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,iBAAiB,GACnD,gBAAgB,EAAE,CAAC;CACtB;AAED;;;;;;GAMG;AACH,MAAM,WAAW,kBAAkB;IAClC;;;;;OAKG;IACH,sBAAsB,CACrB,WAAW,EAAE,gBAAgB,EAC7B,YAAY,EAAE,CAAC,OAAO,EA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AA+B,CAC9C,aAAa,EAAE,uBAAuB,GACpC,SAAS,CAEX"}
@@ -9,8 +9,8 @@ import { brand, brandedNumberType, unbrand, } from "../../../util/index.js";
9
9
  import { TreeCompressionStrategy } from "../../treeCompressionUtils.js";
10
10
  import { decode } from "./chunkDecoding.js";
11
11
  import { validVersions, FieldBatchFormatVersion, EncodedFieldBatchV1, EncodedFieldBatchV2, } from "./format.js";
12
- import { uncompressedEncodeV1, uncompressedEncodeV2 } from "./uncompressedEncode.js";
13
12
  import { schemaCompressedEncodeV1, schemaCompressedEncodeV2 } from "./schemaBasedEncode.js";
13
+ import { uncompressedEncodeV1, uncompressedEncodeV2 } from "./uncompressedEncode.js";
14
14
  const ChunkReferenceId = brandedNumberType({ multipleOf: 1, minimum: 0 });
15
15
  /**
16
16
  * Convert a MinimumVersionForCollab to write version for {@link FieldBatchCodec}.
@@ -1 +1 @@
1
- {"version":3,"file":"codecs.js","sourceRoot":"","sources":["../../../../src/feature-libraries/chunked-forest/codec/codecs.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAE9E,OAAO,EACN,+BAA+B,EAC/B,yBAAyB,GACzB,MAAM,wCAAwC,CAAC;AAEhD,OAAO,EAGN,kBAAkB,EAElB,2BAA2B,GAC3B,MAAM,yBAAyB,CAAC;AAOjC,OAAO,EACN,KAAK,EACL,iBAAiB,EAGjB,OAAO,GACP,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AAExE,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAE5C,OAAO,EAEN,aAAa,EACb,uBAAuB,EACvB,mBAAmB,EACnB,mBAAmB,GACnB,MAAM,aAAa,CAAC;AAGrB,OAAO,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AACrF,OAAO,EAAE,wBAAwB,EAAE,wBAA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AAC;gBACrC,CAAC;YACF,CAAC;YAED,oDAAoD;YACpD,OAAO,OAAO,CAAC;QAChB,CAAC;QACD,MAAM,EAAE,CAAC,IAAuB,EAAE,OAAkC,EAAc,EAAE;YACnF,6CAA6C;YAC7C,OAAO,MAAM,CACZ,IAAI,EACJ;gBACC,YAAY,EAAE,OAAO,CAAC,YAAY;gBAClC,YAAY,EAAE,OAAO,CAAC,YAAY;aAClC,EACD,OAAO,CAAC,yBAAyB,CACjC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC;QAClC,CAAC;KACD,CAAC,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,+BAA+B,CAC9C,aAAsC;IAEtC,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,OAAO,EAAE,gCAAgC,CAAC,aAAa,CAAC,EAAE,CAAC;AACzF,CAAC","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 { IIdCompressor, SessionId } from \"@fluidframework/id-compressor\";\nimport {\n\tgetConfigForMinVersionForCollab,\n\tlowestMinVersionForCollab,\n} from \"@fluidframework/runtime-utils/internal\";\n\nimport {\n\ttype CodecTree,\n\ttype CodecWriteOptions,\n\tFluidClientVersion,\n\ttype IJsonCodec,\n\tmakeVersionedValidatedCodec,\n} from \"../../../codec/index.js\";\nimport {\n\tCursorLocationType,\n\ttype ITreeCursorSynchronous,\n\ttype SchemaAndPolicy,\n\ttype TreeChunk,\n} from \"../../../core/index.js\";\nimport {\n\tbrand,\n\tbrandedNumberType,\n\ttype Brand,\n\ttype JsonCompatibleReadOnly,\n\tunbrand,\n} from \"../../../util/index.js\";\nimport { TreeCompressionStrategy } from \"../../treeCompressionUtils.js\";\n\nimport { decode } from \"./chunkDecoding.js\";\nimport type { FieldBatch } from \"./fieldBatch.js\";\nimport {\n\ttype EncodedFieldBatch,\n\tvalidVersions,\n\tFieldBatchFormatVersion,\n\tEncodedFieldBatchV1,\n\tEncodedFieldBatchV2,\n} from \"./format.js\";\nimport type { MinimumVersionForCollab } from \"@fluidframework/runtime-definitions/internal\";\nimport type { IncrementalEncodingPolicy } from \"./incrementalEncodingPolicy.js\";\nimport { uncompressedEncodeV1, uncompressedEncodeV2 } from \"./uncompressedEncode.js\";\nimport { schemaCompressedEncodeV1, schemaCompressedEncodeV2 } from \"./schemaBasedEncode.js\";\n\n/**\n * Reference ID for a chunk that is incrementally encoded.\n */\nexport type ChunkReferenceId = Brand<number, \"forest.ChunkReferenceId\">;\nconst ChunkReferenceId = brandedNumberType<ChunkReferenceId>({ multipleOf: 1, minimum: 0 });\n\n/**\n * Properties for incremental encoding.\n * Fields that support incremental encoding will encode their chunks separately by calling `encodeIncrementalField`.\n * @remarks\n * This supports features like incremental summarization where the summary from these fields can be re-used if\n * unchanged between summaries.\n * Note that each of these chunks that are incrementally encoded is fully self-describing (contain its own shapes\n * list and identifier table) and does not rely on context from its parent.\n */\nexport interface IncrementalEncoder {\n\t/**\n\t * Returns whether a node / field should be incrementally encoded.\n\t * @remarks See {@link IncrementalEncodingPolicy}.\n\t */\n\tshouldEncodeIncrementally: IncrementalEncodingPolicy;\n\t/**\n\t * Called to encode an incremental field at the cursor.\n\t * The chunks for this field are encoded separately from the main buffer.\n\t * @param cursor - The cursor pointing to the field to encode.\n\t * @param chunkEncoder - A function that encodes the contents of the passed chunk in the field.\n\t * @returns The reference IDs of the encoded chunks in the field.\n\t * This is used to retrieve the encoded chunks later.\n\t */\n\tencodeIncrementalField(\n\t\tcursor: ITreeCursorSynchronous,\n\t\tchunkEncoder: (chunk: TreeChunk) => EncodedFieldBatch,\n\t): ChunkReferenceId[];\n}\n\n/**\n * Properties for incremental decoding.\n *\n * Fields that had their chunks incrementally encoded will retrieve them by calling `getEncodedIncrementalChunk`.\n * @remarks\n * See {@link IncrementalEncoder} for more details.\n */\nexport interface IncrementalDecoder {\n\t/**\n\t * Called to decode an incremental chunk with the given reference ID.\n\t * @param referenceId - The reference ID of the chunk to decode.\n\t * @param chunkDecoder - A function that decodes the chunk.\n\t * @returns The decoded chunk.\n\t */\n\tdecodeIncrementalChunk(\n\t\treferenceId: ChunkReferenceId,\n\t\tchunkDecoder: (encoded: EncodedFieldBatch) => TreeChunk,\n\t): TreeChunk;\n}\n/**\n * Combines the properties of {@link IncrementalEncoder} and {@link IncrementalDecoder}.\n */\nexport interface IncrementalEncoderDecoder extends IncrementalEncoder, IncrementalDecoder {}\n\nexport interface FieldBatchEncodingContext {\n\treadonly encodeType: TreeCompressionStrategy;\n\treadonly idCompressor: IIdCompressor;\n\treadonly originatorId: SessionId;\n\treadonly schema?: SchemaAndPolicy;\n\t/**\n\t * An encoder / decoder for encoding and decoding of incremental fields.\n\t * This will be defined if incremental encoding is supported and enabled.\n\t */\n\treadonly incrementalEncoderDecoder?: IncrementalEncoderDecoder;\n}\n/**\n * @remarks\n * Fields in this batch currently don't have field schema for the root, which limits optimizations.\n */\nexport type FieldBatchCodec = IJsonCodec<\n\tFieldBatch,\n\tEncodedFieldBatch,\n\tJsonCompatibleReadOnly,\n\tFieldBatchEncodingContext\n>;\n\n/**\n * Convert a MinimumVersionForCollab to write version for {@link FieldBatchCodec}.\n * @param clientVersion - The MinimumVersionForCollab to convert.\n */\nfunction clientVersionToFieldBatchVersion(\n\tclientVersion: MinimumVersionForCollab,\n): FieldBatchFormatVersion {\n\treturn brand(\n\t\tgetConfigForMinVersionForCollab(clientVersion, {\n\t\t\t[lowestMinVersionForCollab]: FieldBatchFormatVersion.v1,\n\t\t\t[FluidClientVersion.v2_73]: FieldBatchFormatVersion.v2,\n\t\t}),\n\t);\n}\n\nexport function makeFieldBatchCodec(options: CodecWriteOptions): FieldBatchCodec {\n\tconst writeVersion = clientVersionToFieldBatchVersion(options.minVersionForCollab);\n\t// Note: it's important that the decode function is schema-agnostic for this strategy/layering to work, since\n\t// the schema that an op was encoded in doesn't necessarily match the current schema for the document (e.g. if\n\t// decode is being run on a client that just submitted a schema change, but the op is from another client who has\n\t// yet to receive that change).\n\tassert(\n\t\tvalidVersions.has(writeVersion),\n\t\t0x935 /* Invalid write version for FieldBatch codec */,\n\t);\n\n\tlet uncompressedEncodeFn: typeof uncompressedEncodeV1 | typeof uncompressedEncodeV2;\n\tlet schemaCompressedEncodeFn:\n\t\t| typeof schemaCompressedEncodeV1\n\t\t| typeof schemaCompressedEncodeV2;\n\tlet encodedFieldBatchType: typeof EncodedFieldBatchV1 | typeof EncodedFieldBatchV2;\n\tswitch (writeVersion) {\n\t\tcase unbrand(FieldBatchFormatVersion.v1): {\n\t\t\tuncompressedEncodeFn = uncompressedEncodeV1;\n\t\t\tschemaCompressedEncodeFn = schemaCompressedEncodeV1;\n\t\t\tencodedFieldBatchType = EncodedFieldBatchV1;\n\t\t\tbreak;\n\t\t}\n\t\tcase unbrand(FieldBatchFormatVersion.v2): {\n\t\t\tuncompressedEncodeFn = uncompressedEncodeV2;\n\t\t\tschemaCompressedEncodeFn = schemaCompressedEncodeV2;\n\t\t\tencodedFieldBatchType = EncodedFieldBatchV2;\n\t\t\tbreak;\n\t\t}\n\t\tdefault: {\n\t\t\tunreachableCase(writeVersion);\n\t\t}\n\t}\n\n\treturn makeVersionedValidatedCodec(options, validVersions, encodedFieldBatchType, {\n\t\tencode: (data: FieldBatch, context: FieldBatchEncodingContext): EncodedFieldBatch => {\n\t\t\tfor (const cursor of data) {\n\t\t\t\tassert(\n\t\t\t\t\tcursor.mode === CursorLocationType.Fields,\n\t\t\t\t\t0x8a3 /* FieldBatch expects fields cursors */,\n\t\t\t\t);\n\t\t\t}\n\t\t\tlet encoded: EncodedFieldBatch;\n\t\t\tlet incrementalEncoder: IncrementalEncoder | undefined;\n\t\t\tswitch (context.encodeType) {\n\t\t\t\tcase TreeCompressionStrategy.Uncompressed: {\n\t\t\t\t\tencoded = uncompressedEncodeFn(data);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase TreeCompressionStrategy.CompressedIncremental: {\n\t\t\t\t\tassert(\n\t\t\t\t\t\twriteVersion >= FieldBatchFormatVersion.v2,\n\t\t\t\t\t\t0xca0 /* Unsupported FieldBatchFormatVersion for incremental encoding; must be v2 or higher */,\n\t\t\t\t\t);\n\t\t\t\t\t// Incremental encoding is only supported for CompressedIncremental.\n\t\t\t\t\tincrementalEncoder = context.incrementalEncoderDecoder;\n\t\t\t\t}\n\t\t\t\t// fallthrough\n\t\t\t\tcase TreeCompressionStrategy.Compressed: {\n\t\t\t\t\t// eslint-disable-next-line unicorn/prefer-ternary\n\t\t\t\t\tif (context.schema === undefined) {\n\t\t\t\t\t\t// TODO: consider enabling a somewhat compressed but not schema accelerated encode.\n\t\t\t\t\t\tencoded = uncompressedEncodeFn(data);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tencoded = schemaCompressedEncodeFn(\n\t\t\t\t\t\t\tcontext.schema.schema,\n\t\t\t\t\t\t\tcontext.schema.policy,\n\t\t\t\t\t\t\tdata,\n\t\t\t\t\t\t\tcontext.idCompressor,\n\t\t\t\t\t\t\tincrementalEncoder,\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tdefault: {\n\t\t\t\t\tunreachableCase(context.encodeType);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// TODO: consider checking input data was in schema.\n\t\t\treturn encoded;\n\t\t},\n\t\tdecode: (data: EncodedFieldBatch, context: FieldBatchEncodingContext): FieldBatch => {\n\t\t\t// TODO: consider checking data is in schema.\n\t\t\treturn decode(\n\t\t\t\tdata,\n\t\t\t\t{\n\t\t\t\t\tidCompressor: context.idCompressor,\n\t\t\t\t\toriginatorId: context.originatorId,\n\t\t\t\t},\n\t\t\t\tcontext.incrementalEncoderDecoder,\n\t\t\t).map((chunk) => chunk.cursor());\n\t\t},\n\t});\n}\n\nexport function getCodecTreeForFieldBatchFormat(\n\tclientVersion: MinimumVersionForCollab,\n): CodecTree {\n\treturn { name: \"FieldBatch\", version: clientVersionToFieldBatchVersion(clientVersion) };\n}\n"]}
1
+ {"version":3,"file":"codecs.js","sourceRoot":"","sources":["../../../../src/feature-libraries/chunked-forest/codec/codecs.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAG9E,OAAO,EACN,+BAA+B,EAC/B,yBAAyB,GACzB,MAAM,wCAAwC,CAAC;AAEhD,OAAO,EAGN,kBAAkB,EAElB,2BAA2B,GAC3B,MAAM,yBAAyB,CAAC;AAOjC,OAAO,EACN,KAAK,EACL,iBAAiB,EAGjB,OAAO,GACP,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AAExE,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAE5C,OAAO,EAEN,aAAa,EACb,uBAAuB,EACvB,mBAAmB,EACnB,mBAAmB,GACnB,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,wBAAwB,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAC5F,OAAO,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAMrF,MAAM,gBAAgB,GAAG,iBAAiB,CAAmB,EAAE,UAAU,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC,CAAC;AA6E5F;;;GAGG;AACH,SAAS,gCAAgC,CACxC,aAAsC;IAEtC,OAAO,KAAK,CACX,+BAA+B,CAAC,aAAa,EAAE;QAC9C,CAAC,yBAAyB,CAAC,EAAE,uBAAuB,CAAC,EAAE;QACvD,CAAC,kBAAkB,CAAC,KAAK,CAAC,EAAE,uBAAuB,CAAC,EAAE;KACtD,CAAC,CACF,CAAC;AACH,CAAC;AAED,MAAM,UAAU,mBAAmB,CAAC,OAA0B;IAC7D,MAAM,YAAY,GAAG,gCA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;IAEtC,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,OAAO,EAAE,gCAAgC,CAAC,aAAa,CAAC,EAAE,CAAC;AACzF,CAAC","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 { IIdCompressor, SessionId } 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\tFluidClientVersion,\n\ttype IJsonCodec,\n\tmakeVersionedValidatedCodec,\n} from \"../../../codec/index.js\";\nimport {\n\tCursorLocationType,\n\ttype ITreeCursorSynchronous,\n\ttype SchemaAndPolicy,\n\ttype TreeChunk,\n} from \"../../../core/index.js\";\nimport {\n\tbrand,\n\tbrandedNumberType,\n\ttype Brand,\n\ttype JsonCompatibleReadOnly,\n\tunbrand,\n} from \"../../../util/index.js\";\nimport { TreeCompressionStrategy } from \"../../treeCompressionUtils.js\";\n\nimport { decode } from \"./chunkDecoding.js\";\nimport type { FieldBatch } from \"./fieldBatch.js\";\nimport {\n\ttype EncodedFieldBatch,\n\tvalidVersions,\n\tFieldBatchFormatVersion,\n\tEncodedFieldBatchV1,\n\tEncodedFieldBatchV2,\n} from \"./format.js\";\nimport type { IncrementalEncodingPolicy } from \"./incrementalEncodingPolicy.js\";\nimport { schemaCompressedEncodeV1, schemaCompressedEncodeV2 } from \"./schemaBasedEncode.js\";\nimport { uncompressedEncodeV1, uncompressedEncodeV2 } from \"./uncompressedEncode.js\";\n\n/**\n * Reference ID for a chunk that is incrementally encoded.\n */\nexport type ChunkReferenceId = Brand<number, \"forest.ChunkReferenceId\">;\nconst ChunkReferenceId = brandedNumberType<ChunkReferenceId>({ multipleOf: 1, minimum: 0 });\n\n/**\n * Properties for incremental encoding.\n * Fields that support incremental encoding will encode their chunks separately by calling `encodeIncrementalField`.\n * @remarks\n * This supports features like incremental summarization where the summary from these fields can be re-used if\n * unchanged between summaries.\n * Note that each of these chunks that are incrementally encoded is fully self-describing (contain its own shapes\n * list and identifier table) and does not rely on context from its parent.\n */\nexport interface IncrementalEncoder {\n\t/**\n\t * Returns whether a node / field should be incrementally encoded.\n\t * @remarks See {@link IncrementalEncodingPolicy}.\n\t */\n\tshouldEncodeIncrementally: IncrementalEncodingPolicy;\n\t/**\n\t * Called to encode an incremental field at the cursor.\n\t * The chunks for this field are encoded separately from the main buffer.\n\t * @param cursor - The cursor pointing to the field to encode.\n\t * @param chunkEncoder - A function that encodes the contents of the passed chunk in the field.\n\t * @returns The reference IDs of the encoded chunks in the field.\n\t * This is used to retrieve the encoded chunks later.\n\t */\n\tencodeIncrementalField(\n\t\tcursor: ITreeCursorSynchronous,\n\t\tchunkEncoder: (chunk: TreeChunk) => EncodedFieldBatch,\n\t): ChunkReferenceId[];\n}\n\n/**\n * Properties for incremental decoding.\n *\n * Fields that had their chunks incrementally encoded will retrieve them by calling `getEncodedIncrementalChunk`.\n * @remarks\n * See {@link IncrementalEncoder} for more details.\n */\nexport interface IncrementalDecoder {\n\t/**\n\t * Called to decode an incremental chunk with the given reference ID.\n\t * @param referenceId - The reference ID of the chunk to decode.\n\t * @param chunkDecoder - A function that decodes the chunk.\n\t * @returns The decoded chunk.\n\t */\n\tdecodeIncrementalChunk(\n\t\treferenceId: ChunkReferenceId,\n\t\tchunkDecoder: (encoded: EncodedFieldBatch) => TreeChunk,\n\t): TreeChunk;\n}\n/**\n * Combines the properties of {@link IncrementalEncoder} and {@link IncrementalDecoder}.\n */\nexport interface IncrementalEncoderDecoder extends IncrementalEncoder, IncrementalDecoder {}\n\nexport interface FieldBatchEncodingContext {\n\treadonly encodeType: TreeCompressionStrategy;\n\treadonly idCompressor: IIdCompressor;\n\treadonly originatorId: SessionId;\n\treadonly schema?: SchemaAndPolicy;\n\t/**\n\t * An encoder / decoder for encoding and decoding of incremental fields.\n\t * This will be defined if incremental encoding is supported and enabled.\n\t */\n\treadonly incrementalEncoderDecoder?: IncrementalEncoderDecoder;\n}\n/**\n * @remarks\n * Fields in this batch currently don't have field schema for the root, which limits optimizations.\n */\nexport type FieldBatchCodec = IJsonCodec<\n\tFieldBatch,\n\tEncodedFieldBatch,\n\tJsonCompatibleReadOnly,\n\tFieldBatchEncodingContext\n>;\n\n/**\n * Convert a MinimumVersionForCollab to write version for {@link FieldBatchCodec}.\n * @param clientVersion - The MinimumVersionForCollab to convert.\n */\nfunction clientVersionToFieldBatchVersion(\n\tclientVersion: MinimumVersionForCollab,\n): FieldBatchFormatVersion {\n\treturn brand(\n\t\tgetConfigForMinVersionForCollab(clientVersion, {\n\t\t\t[lowestMinVersionForCollab]: FieldBatchFormatVersion.v1,\n\t\t\t[FluidClientVersion.v2_73]: FieldBatchFormatVersion.v2,\n\t\t}),\n\t);\n}\n\nexport function makeFieldBatchCodec(options: CodecWriteOptions): FieldBatchCodec {\n\tconst writeVersion = clientVersionToFieldBatchVersion(options.minVersionForCollab);\n\t// Note: it's important that the decode function is schema-agnostic for this strategy/layering to work, since\n\t// the schema that an op was encoded in doesn't necessarily match the current schema for the document (e.g. if\n\t// decode is being run on a client that just submitted a schema change, but the op is from another client who has\n\t// yet to receive that change).\n\tassert(\n\t\tvalidVersions.has(writeVersion),\n\t\t0x935 /* Invalid write version for FieldBatch codec */,\n\t);\n\n\tlet uncompressedEncodeFn: typeof uncompressedEncodeV1 | typeof uncompressedEncodeV2;\n\tlet schemaCompressedEncodeFn:\n\t\t| typeof schemaCompressedEncodeV1\n\t\t| typeof schemaCompressedEncodeV2;\n\tlet encodedFieldBatchType: typeof EncodedFieldBatchV1 | typeof EncodedFieldBatchV2;\n\tswitch (writeVersion) {\n\t\tcase unbrand(FieldBatchFormatVersion.v1): {\n\t\t\tuncompressedEncodeFn = uncompressedEncodeV1;\n\t\t\tschemaCompressedEncodeFn = schemaCompressedEncodeV1;\n\t\t\tencodedFieldBatchType = EncodedFieldBatchV1;\n\t\t\tbreak;\n\t\t}\n\t\tcase unbrand(FieldBatchFormatVersion.v2): {\n\t\t\tuncompressedEncodeFn = uncompressedEncodeV2;\n\t\t\tschemaCompressedEncodeFn = schemaCompressedEncodeV2;\n\t\t\tencodedFieldBatchType = EncodedFieldBatchV2;\n\t\t\tbreak;\n\t\t}\n\t\tdefault: {\n\t\t\tunreachableCase(writeVersion);\n\t\t}\n\t}\n\n\treturn makeVersionedValidatedCodec(options, validVersions, encodedFieldBatchType, {\n\t\tencode: (data: FieldBatch, context: FieldBatchEncodingContext): EncodedFieldBatch => {\n\t\t\tfor (const cursor of data) {\n\t\t\t\tassert(\n\t\t\t\t\tcursor.mode === CursorLocationType.Fields,\n\t\t\t\t\t0x8a3 /* FieldBatch expects fields cursors */,\n\t\t\t\t);\n\t\t\t}\n\t\t\tlet encoded: EncodedFieldBatch;\n\t\t\tlet incrementalEncoder: IncrementalEncoder | undefined;\n\t\t\tswitch (context.encodeType) {\n\t\t\t\tcase TreeCompressionStrategy.Uncompressed: {\n\t\t\t\t\tencoded = uncompressedEncodeFn(data);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase TreeCompressionStrategy.CompressedIncremental: {\n\t\t\t\t\tassert(\n\t\t\t\t\t\twriteVersion >= FieldBatchFormatVersion.v2,\n\t\t\t\t\t\t0xca0 /* Unsupported FieldBatchFormatVersion for incremental encoding; must be v2 or higher */,\n\t\t\t\t\t);\n\t\t\t\t\t// Incremental encoding is only supported for CompressedIncremental.\n\t\t\t\t\tincrementalEncoder = context.incrementalEncoderDecoder;\n\t\t\t\t}\n\t\t\t\t// fallthrough\n\t\t\t\tcase TreeCompressionStrategy.Compressed: {\n\t\t\t\t\t// eslint-disable-next-line unicorn/prefer-ternary\n\t\t\t\t\tif (context.schema === undefined) {\n\t\t\t\t\t\t// TODO: consider enabling a somewhat compressed but not schema accelerated encode.\n\t\t\t\t\t\tencoded = uncompressedEncodeFn(data);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tencoded = schemaCompressedEncodeFn(\n\t\t\t\t\t\t\tcontext.schema.schema,\n\t\t\t\t\t\t\tcontext.schema.policy,\n\t\t\t\t\t\t\tdata,\n\t\t\t\t\t\t\tcontext.idCompressor,\n\t\t\t\t\t\t\tincrementalEncoder,\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tdefault: {\n\t\t\t\t\tunreachableCase(context.encodeType);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// TODO: consider checking input data was in schema.\n\t\t\treturn encoded;\n\t\t},\n\t\tdecode: (data: EncodedFieldBatch, context: FieldBatchEncodingContext): FieldBatch => {\n\t\t\t// TODO: consider checking data is in schema.\n\t\t\treturn decode(\n\t\t\t\tdata,\n\t\t\t\t{\n\t\t\t\t\tidCompressor: context.idCompressor,\n\t\t\t\t\toriginatorId: context.originatorId,\n\t\t\t\t},\n\t\t\t\tcontext.incrementalEncoderDecoder,\n\t\t\t).map((chunk) => chunk.cursor());\n\t\t},\n\t});\n}\n\nexport function getCodecTreeForFieldBatchFormat(\n\tclientVersion: MinimumVersionForCollab,\n): CodecTree {\n\treturn { name: \"FieldBatch\", version: clientVersionToFieldBatchVersion(clientVersion) };\n}\n"]}
@@ -6,9 +6,9 @@ import type { IIdCompressor } from "@fluidframework/id-compressor";
6
6
  import { type FieldKey, type FieldKindData, type FieldKindIdentifier, type ITreeCursorSynchronous, type TreeFieldStoredSchema, type TreeNodeSchemaIdentifier, type Value } from "../../../core/index.js";
7
7
  import type { Counter, DeduplicationTable } from "./chunkCodecUtilities.js";
8
8
  import { type BufferFormat as BufferFormatGeneric, Shape as ShapeGeneric } from "./chunkEncodingGeneric.js";
9
+ import type { IncrementalEncoder } from "./codecs.js";
9
10
  import type { FieldBatch } from "./fieldBatch.js";
10
11
  import { type EncodedChunkShape, type EncodedFieldBatch, type EncodedValueShape, FieldBatchFormatVersion } from "./format.js";
11
- import type { IncrementalEncoder } from "./codecs.js";
12
12
  /**
13
13
  * Encode data from `FieldBatch` into an `EncodedFieldBatch`.
14
14
  *
@@ -1 +1 @@
1
- {"version":3,"file":"compressedEncode.d.ts","sourceRoot":"","sources":["../../../../src/feature-libraries/chunked-forest/codec/compressedEncode.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAEnE,OAAO,EAEN,KAAK,QAAQ,EACb,KAAK,aAAa,EAClB,KAAK,mBAAmB,EACxB,KAAK,sBAAsB,EAE3B,KAAK,qBAAqB,EAC1B,KAAK,wBAAwB,EAC7B,KAAK,KAAK,EAEV,MAAM,wBAAwB,CAAC;AAGhC,OAAO,KAAK,EAAE,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC5E,OAAO,EACN,KAAK,YAAY,IAAI,mBAAmB,EACxC,KAAK,IAAI,YAAY,EAErB,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAEN,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EAEtB,KAAK,iBAAiB,EACtB,uBAAuB,EAEvB,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEtD;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAC/B,UAAU,EAAE,UAAU,EACtB,OAAO,EAAE,cAAc,GACrB,iBAAiB,CAUnB;AAED,MAAM,MAAM,YAAY,GAAG,mBAAmB,CAAC,iBAAiB,CAAC,CAAC;AAClE,MAAM,MAAM,KAAK,GAAG,YAAY,CAAC,iBAAiB,CAAC,CAAC;AAEpD;;GAEG;AACH,MAAM,WAAW,iBAAiB;IACjC,QAAQ,CAAC,GAAG,EAAE,QAAQ,CAAC;IACvB,QA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B;aACvB,WAAW,EAAE,WAAW,CAAC,mBAAmB,EAAE,aAAa,CAAC;aAC5D,YAAY,EAAE,aAAa;IAC3C;;;;OAIG;aACa,kBAAkB,EAAE,kBAAkB,GAAG,SAAS;aAClD,OAAO,EAAE,uBAAuB;IAdjD,OAAO,CAAC,QAAQ,CAAC,sBAAsB,CAC5B;IACX,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAAmD;gBAErE,qBAAqB,EAAE,iBAAiB,EACxC,sBAAsB,EAAE,kBAAkB,EAC3C,WAAW,EAAE,WAAW,CAAC,mBAAmB,EAAE,aAAa,CAAC,EAC5D,YAAY,EAAE,aAAa;IAC3C;;;;OAIG;IACa,kBAAkB,EAAE,kBAAkB,GAAG,SAAS,EAClD,OAAO,EAAE,uBAAuB;IAG1C,qBAAqB,CAAC,UAAU,EAAE,wBAAwB,GAAG,WAAW;IAMxE,sBAAsB,CAAC,WAAW,EAAE,qBAAqB,GAAG,YAAY;IAIxE,kBAAkB,CAAC,KAAK,EAAE,WAAW,GAAG,kBAAkB;CAGjE;AAED,MAAM,WAAW,iBAAiB;IACjC,qBAAqB,CAAC,UAAU,EAAE,wBAAwB,GAAG,WAAW,CAAC;CACzE;AAED,MAAM,WAAW,kBAAkB;IAClC,sBAAsB,CAAC,MAAM,EAAE,qBAAqB,GAAG,YAAY,CAAC;CACpE;AAED;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,CAChC,WAAW,EAAE,iBAAiB,EAC9B,MAAM,EAAE,qBAAqB,KACzB,YAAY,CAAC;AAElB;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,CAC/B,YAAY,EAAE,kBAAkB,EAChC,UAAU,EAAE,wBAAwB,KAChC,WAAW,CAAC"}
1
+ {"version":3,"file":"compressedEncode.d.ts","sourceRoot":"","sources":["../../../../src/feature-libraries/chunked-forest/codec/compressedEncode.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BA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B,EAC3C,WAAW,EAAE,WAAW,CAAC,mBAAmB,EAAE,aAAa,CAAC,EAC5D,YAAY,EAAE,aAAa;IAC3C;;;;OAIG;IACa,kBAAkB,EAAE,kBAAkB,GAAG,SAAS,EAClD,OAAO,EAAE,uBAAuB;IAG1C,qBAAqB,CAAC,UAAU,EAAE,wBAAwB,GAAG,WAAW;IAMxE,sBAAsB,CAAC,WAAW,EAAE,qBAAqB,GAAG,YAAY;IAIxE,kBAAkB,CAAC,KAAK,EAAE,WAAW,GAAG,kBAAkB;CAGjE;AAED,MAAM,WAAW,iBAAiB;IACjC,qBAAqB,CAAC,UAAU,EAAE,wBAAwB,GAAG,WAAW,CAAC;CACzE;AAED,MAAM,WAAW,kBAAkB;IAClC,sBAAsB,CAAC,MAAM,EAAE,qBAAqB,GAAG,YAAY,CAAC;CACpE;AAED;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,CAChC,WAAW,EAAE,iBAAiB,EAC9B,MAAM,EAAE,qBAAqB,KACzB,YAAY,CAAC;AAElB;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,CAC/B,YAAY,EAAE,kBAAkB,EAChC,UAAU,EAAE,wBAAwB,KAChC,WAAW,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"compressedEncode.js","sourceRoot":"","sources":["../../../../src/feature-libraries/chunked-forest/codec/compressedEncode.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,qCAAqC,CAAC;AAGpF,OAAO,EAUN,WAAW,GACX,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAGrD,OAAO,EAEN,KAAK,IAAI,YAAY,EACrB,kCAAkC,GAClC,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EAMN,uBAAuB,EACvB,YAAY,GACZ,MAAM,aAAa,CAAC;AAGrB;;;;;;GAMG;AACH,MAAM,UAAU,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*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, unreachableCase, fail } from \"@fluidframework/core-utils/internal\";\nimport type { IIdCompressor } from \"@fluidframework/id-compressor\";\n\nimport {\n\tCursorLocationType,\n\ttype FieldKey,\n\ttype FieldKindData,\n\ttype FieldKindIdentifier,\n\ttype ITreeCursorSynchronous,\n\ttype TreeChunk,\n\ttype TreeFieldStoredSchema,\n\ttype TreeNodeSchemaIdentifier,\n\ttype Value,\n\tforEachNode,\n} from \"../../../core/index.js\";\nimport { getOrCreate } from \"../../../util/index.js\";\n\nimport type { Counter, DeduplicationTable } from \"./chunkCodecUtilities.js\";\nimport {\n\ttype BufferFormat as BufferFormatGeneric,\n\tShape as ShapeGeneric,\n\tupdateShapesAndIdentifiersEncoding,\n} from \"./chunkEncodingGeneric.js\";\nimport type { FieldBatch } from \"./fieldBatch.js\";\nimport {\n\ttype EncodedAnyShape,\n\ttype EncodedChunkShape,\n\ttype EncodedFieldBatch,\n\ttype EncodedNestedArrayShape,\n\ttype EncodedValueShape,\n\tFieldBatchFormatVersion,\n\tSpecialField,\n} from \"./format.js\";\nimport type { IncrementalEncoder } from \"./codecs.js\";\n\n/**\n * Encode data from `FieldBatch` into an `EncodedFieldBatch`.\n *\n * Optimized for encoded size and encoding performance.\n *\n * Most of the compression strategy comes from the policy provided via `context`.\n */\nexport function compressedEncode(\n\tfieldBatch: FieldBatch,\n\tcontext: EncoderContext,\n): EncodedFieldBatch {\n\tconst batchBuffer: BufferFormat[] = [];\n\n\t// Populate buffer, including shape and identifier references\n\tfor (const cursor of fieldBatch) {\n\t\tconst buffer: BufferFormat = [];\n\t\tanyFieldEncoder.encodeField(cursor, context, buffer);\n\t\tbatchBuffer.push(buffer);\n\t}\n\treturn updateShapesAndIdentifiersEncoding(context.version, batchBuffer);\n}\n\nexport type BufferFormat = BufferFormatGeneric<EncodedChunkShape>;\nexport type Shape = ShapeGeneric<EncodedChunkShape>;\n\n/**\n * Like {@link FieldEncoder}, except data will be prefixed with the key.\n */\nexport interface KeyedFieldEncoder {\n\treadonly key: FieldKey;\n\treadonly encoder: FieldEncoder;\n}\n\n/**\n * An encoder with an associated shape.\n */\nexport interface Encoder {\n\t/**\n\t * The shape which describes how the encoded data is laid out.\n\t * Used by decoders to interpret the output of `encodeNode`.\n\t */\n\treadonly shape: Shape;\n}\n\n/**\n * An encoder for a specific shape of node.\n *\n * Can only be used with compatible nodes.\n */\nexport interface NodeEncoder extends Encoder {\n\t/**\n\t * @param cursor - in Nodes mode. Does not move cursor.\n\t */\n\tencodeNode(\n\t\tcursor: ITreeCursorSynchronous,\n\t\tcontext: EncoderContext,\n\t\toutputBuffer: BufferFormat,\n\t): void;\n}\n\n/**\n * Like {@link NodeEncoder}, except encodes a run of nodes.\n */\nexport interface NodesEncoder extends Encoder {\n\t/**\n\t * @param cursor - in Nodes mode. Moves cursor however many nodes it encodes.\n\t */\n\tencodeNodes(\n\t\tcursor: ITreeCursorSynchronous,\n\t\tcontext: EncoderContext,\n\t\toutputBuffer: BufferFormat,\n\t): void;\n}\n\n/**\n * Like {@link NodeEncoder}, except encodes a field.\n */\nexport interface FieldEncoder extends Encoder {\n\t/**\n\t * @param cursor - in Fields mode. Encodes entire field.\n\t */\n\tencodeField(\n\t\tcursor: ITreeCursorSynchronous,\n\t\tcontext: EncoderContext,\n\t\toutputBuffer: BufferFormat,\n\t): void;\n}\n\n/**\n * Makes a {@link FieldEncoder} which runs `encoder` on every node in the field.\n * This does not encode the number nodes: the user of this may need to encode that elsewhere.\n */\nexport function asFieldEncoder(encoder: NodeEncoder): FieldEncoder {\n\treturn {\n\t\tencodeField(\n\t\t\tcursor: ITreeCursorSynchronous,\n\t\t\tcontext: EncoderContext,\n\t\t\toutputBuffer: BufferFormat,\n\t\t): void {\n\t\t\tforEachNode(cursor, () => encoder.encodeNode(cursor, context, outputBuffer));\n\t\t},\n\t\tshape: encoder.shape,\n\t};\n}\n\n/**\n * Adapt a {@link NodeEncoder} to a {@link NodesEncoder} which invokes `encoder` once.\n */\nexport function asNodesEncoder(encoder: NodeEncoder): NodesEncoder {\n\treturn {\n\t\tencodeNodes(\n\t\t\tcursor: ITreeCursorSynchronous,\n\t\t\tcontext: EncoderContext,\n\t\t\toutputBuffer: BufferFormat,\n\t\t): void {\n\t\t\tencoder.encodeNode(cursor, context, outputBuffer);\n\t\t\tcursor.nextNode();\n\t\t},\n\t\tshape: encoder.shape,\n\t};\n}\n\n/**\n * Encodes a chunk with {@link EncodedAnyShape} by prefixing the data with its shape.\n */\nexport class AnyShape extends ShapeGeneric<EncodedChunkShape> {\n\tprivate constructor() {\n\t\tsuper();\n\t}\n\tpublic static readonly instance = new AnyShape();\n\n\tpublic encodeShape(\n\t\tidentifiers: DeduplicationTable<string>,\n\t\tshapes: DeduplicationTable<Shape>,\n\t): EncodedChunkShape {\n\t\tconst encodedAnyShape: EncodedAnyShape = 0;\n\t\treturn { d: encodedAnyShape };\n\t}\n\n\tpublic countReferencedShapesAndIdentifiers(\n\t\tidentifiers: Counter<string>,\n\t\tshapeDiscovered: (shape: Shape) => void,\n\t): void {}\n\n\tpublic static encodeField(\n\t\tcursor: ITreeCursorSynchronous,\n\t\tcontext: EncoderContext,\n\t\toutputBuffer: BufferFormat,\n\t\tencoder: FieldEncoder,\n\t): void {\n\t\toutputBuffer.push(encoder.shape);\n\t\tencoder.encodeField(cursor, context, outputBuffer);\n\t}\n\n\tpublic static encodeNode(\n\t\tcursor: ITreeCursorSynchronous,\n\t\tcontext: EncoderContext,\n\t\toutputBuffer: BufferFormat,\n\t\tencoder: NodeEncoder,\n\t): void {\n\t\toutputBuffer.push(encoder.shape);\n\t\tencoder.encodeNode(cursor, context, outputBuffer);\n\t}\n\n\tpublic static encodeNodes(\n\t\tcursor: ITreeCursorSynchronous,\n\t\tcontext: EncoderContext,\n\t\toutputBuffer: BufferFormat,\n\t\tencoder: NodesEncoder,\n\t): void {\n\t\toutputBuffer.push(encoder.shape);\n\t\tencoder.encodeNodes(cursor, context, outputBuffer);\n\t}\n}\n\n/**\n * Encodes a single node polymorphically.\n */\nexport const anyNodeEncoder: NodeEncoder = {\n\tencodeNode(\n\t\tcursor: ITreeCursorSynchronous,\n\t\tcontext: EncoderContext,\n\t\toutputBuffer: BufferFormat,\n\t): void {\n\t\t// TODO: Fast path uniform chunk content.\n\t\tconst nodeEncoder = context.nodeEncoderFromSchema(cursor.type);\n\t\tAnyShape.encodeNode(cursor, context, outputBuffer, nodeEncoder);\n\t},\n\n\tshape: AnyShape.instance,\n};\n\n/**\n * Encodes a field polymorphically.\n */\nexport const anyFieldEncoder: FieldEncoder = {\n\tencodeField(\n\t\tcursor: ITreeCursorSynchronous,\n\t\tcontext: EncoderContext,\n\t\toutputBuffer: BufferFormat,\n\t): void {\n\t\t// TODO: Fast path uniform chunks.\n\n\t\tif (cursor.getFieldLength() === 0) {\n\t\t\tconst shape = InlineArrayEncoder.empty;\n\t\t\tAnyShape.encodeField(cursor, context, outputBuffer, shape);\n\t\t} else if (cursor.getFieldLength() === 1) {\n\t\t\t// Fast path chunk of size one size one at least: skip nested array.\n\t\t\tcursor.enterNode(0);\n\t\t\tanyNodeEncoder.encodeNode(cursor, context, outputBuffer);\n\t\t\tcursor.exitNode();\n\t\t} else {\n\t\t\t// TODO: more efficient encoding for common cases.\n\t\t\t// Could try to find more specific shape compatible with all children than `anyNodeEncoder`.\n\n\t\t\tconst shape = context.nestedArrayEncoder(anyNodeEncoder);\n\t\t\tAnyShape.encodeField(cursor, context, outputBuffer, shape);\n\t\t}\n\t},\n\n\tshape: AnyShape.instance,\n};\n\n/**\n * Encodes a chunk using {@link EncodedInlineArrayShape}.\n * @remarks\n * The fact this is also a Shape is an implementation detail of the encoder: that allows the shape it uses to be itself,\n * which is an easy way to keep all the related code together without extra objects.\n */\nexport class InlineArrayEncoder\n\textends ShapeGeneric<EncodedChunkShape>\n\timplements NodesEncoder, FieldEncoder\n{\n\tpublic static readonly empty: InlineArrayEncoder = new InlineArrayEncoder(0, {\n\t\tget shape() {\n\t\t\t// Not actually used, makes count work without adding an additional shape.\n\t\t\treturn InlineArrayEncoder.empty;\n\t\t},\n\t\tencodeNodes(\n\t\t\tcursor: ITreeCursorSynchronous,\n\t\t\tcontext: EncoderContext,\n\t\t\toutputBuffer: BufferFormat,\n\t\t): void {\n\t\t\tfail(0xb4d /* Empty array should not encode any nodes */);\n\t\t},\n\t});\n\n\t/**\n\t * @param length - number of invocations of `inner`.\n\t */\n\tpublic constructor(\n\t\tpublic readonly length: number,\n\t\tpublic readonly inner: NodesEncoder,\n\t) {\n\t\tsuper();\n\t}\n\n\tpublic encodeNodes(\n\t\tcursor: ITreeCursorSynchronous,\n\t\tcontext: EncoderContext,\n\t\toutputBuffer: BufferFormat,\n\t): void {\n\t\t// Linter is wrong about this loop being for-of compatible.\n\t\t// eslint-disable-next-line @typescript-eslint/prefer-for-of\n\t\tfor (let index = 0; index < this.length; index++) {\n\t\t\tthis.inner.encodeNodes(cursor, context, outputBuffer);\n\t\t}\n\t}\n\n\tpublic encodeField(\n\t\tcursor: ITreeCursorSynchronous,\n\t\tcontext: EncoderContext,\n\t\toutputBuffer: BufferFormat,\n\t): void {\n\t\t// Its possible individual items from this array encode multiple nodes, so don't assume === here.\n\t\tassert(\n\t\t\tcursor.getFieldLength() >= this.length,\n\t\t\t0x73c /* unexpected length for fixed length array */,\n\t\t);\n\t\tcursor.firstNode();\n\t\tthis.encodeNodes(cursor, context, outputBuffer);\n\t\tassert(\n\t\t\tcursor.mode === CursorLocationType.Fields,\n\t\t\t0x73d /* should return to fields mode when finished encoding */,\n\t\t);\n\t}\n\n\tpublic encodeShape(\n\t\tidentifiers: DeduplicationTable<string>,\n\t\tshapes: DeduplicationTable<Shape>,\n\t): EncodedChunkShape {\n\t\treturn {\n\t\t\tb: {\n\t\t\t\tlength: this.length,\n\t\t\t\tshape: shapes.valueToIndex.get(this.inner.shape) ?? fail(0xb4e /* missing shape */),\n\t\t\t},\n\t\t};\n\t}\n\n\tpublic countReferencedShapesAndIdentifiers(\n\t\tidentifiers: Counter<string>,\n\t\tshapeDiscovered: (shape: Shape) => void,\n\t): void {\n\t\tshapeDiscovered(this.inner.shape);\n\t}\n\n\tpublic get shape(): this {\n\t\treturn this;\n\t}\n}\n\n/**\n * Encodes the shape for a nested array as {@link EncodedNestedArrayShape} shape.\n */\nexport class NestedArrayShape extends ShapeGeneric<EncodedChunkShape> {\n\t/**\n\t * @param innerShape - The shape of each item in this nested array.\n\t */\n\tpublic constructor(public readonly innerShape: Shape) {\n\t\tsuper();\n\t}\n\n\tpublic encodeShape(\n\t\tidentifiers: DeduplicationTable<string>,\n\t\tshapes: DeduplicationTable<Shape>,\n\t): EncodedChunkShape {\n\t\tconst shape: EncodedNestedArrayShape =\n\t\t\tshapes.valueToIndex.get(this.innerShape) ??\n\t\t\tfail(0xb4f /* index for shape not found in table */);\n\t\treturn {\n\t\t\ta: shape,\n\t\t};\n\t}\n\n\tpublic countReferencedShapesAndIdentifiers(\n\t\tidentifiers: Counter<string>,\n\t\tshapeDiscovered: (shape: Shape) => void,\n\t): void {\n\t\tshapeDiscovered(this.innerShape);\n\t}\n}\n\n/**\n * Encodes a field as a nested array with the {@link EncodedNestedArrayShape} shape.\n * @remarks\n * The fact this is also exposes a Shape is an implementation detail: it allows the shape it uses to be itself\n * which is an easy way to keep all the related code together without extra objects.\n */\nexport class NestedArrayEncoder implements FieldEncoder {\n\tpublic constructor(\n\t\tpublic readonly innerEncoder: NodeEncoder,\n\t\tpublic readonly shape: NestedArrayShape = new NestedArrayShape(innerEncoder.shape),\n\t) {}\n\n\tpublic encodeField(\n\t\tcursor: ITreeCursorSynchronous,\n\t\tcontext: EncoderContext,\n\t\toutputBuffer: BufferFormat,\n\t): void {\n\t\tconst buffer: BufferFormat = [];\n\t\tlet allNonZeroSize = true;\n\t\tconst length = cursor.getFieldLength();\n\t\tforEachNode(cursor, () => {\n\t\t\tconst before = buffer.length;\n\t\t\tthis.innerEncoder.encodeNode(cursor, context, buffer);\n\t\t\tallNonZeroSize &&= buffer.length - before !== 0;\n\t\t});\n\t\tif (buffer.length === 0) {\n\t\t\t// This relies on the number of inner chunks being the same as the number of nodes.\n\t\t\t// If making inner a `NodesEncoder`, this code will have to be adjusted accordingly.\n\t\t\toutputBuffer.push(length);\n\t\t} else {\n\t\t\tassert(\n\t\t\t\tallNonZeroSize,\n\t\t\t\t0x73e /* either all or none of the members of a nested array must be 0 sized, or there is no way the decoder could process the content correctly. */,\n\t\t\t);\n\t\t\toutputBuffer.push(buffer);\n\t\t}\n\t}\n}\n\n/**\n * Encodes the shape for an incremental chunk as {@link EncodedIncrementalChunkShape} shape.\n */\nexport class IncrementalChunkShape extends ShapeGeneric<EncodedChunkShape> {\n\tpublic encodeShape(\n\t\tidentifiers: DeduplicationTable<string>,\n\t\tshapes: DeduplicationTable<Shape>,\n\t): EncodedChunkShape {\n\t\treturn {\n\t\t\te: 0 /* EncodedIncrementalChunkShape */,\n\t\t};\n\t}\n\n\tpublic countReferencedShapesAndIdentifiers(\n\t\tidentifiers: Counter<string>,\n\t\tshapeDiscovered: (shape: Shape) => void,\n\t): void {}\n\n\tpublic get shape(): this {\n\t\treturn this;\n\t}\n}\n\n/**\n * Encodes an incremental field whose tree chunks are encoded separately and referenced by their {@link ChunkReferenceId}.\n * The shape of the content of this field is {@link NestedArrayShape}.\n * The inner items of the array have shape {@link IncrementalChunkShape} and are {@link ChunkReferenceId}s\n * of the encoded chunks.\n */\nexport const incrementalFieldEncoder: FieldEncoder = {\n\tencodeField(\n\t\tcursor: ITreeCursorSynchronous,\n\t\tcontext: EncoderContext,\n\t\toutputBuffer: BufferFormat,\n\t): void {\n\t\tassert(\n\t\t\tcontext.incrementalEncoder !== undefined,\n\t\t\t0xc88 /* incremental encoder must be defined to use incrementalFieldEncoder */,\n\t\t);\n\t\tassert(\n\t\t\tcontext.version >= FieldBatchFormatVersion.v2,\n\t\t\t0xca1 /* Unsupported FieldBatchFormatVersion for incremental encoding; must be v2 or higher */,\n\t\t);\n\n\t\tconst chunkReferenceIds = context.incrementalEncoder.encodeIncrementalField(\n\t\t\tcursor,\n\t\t\t(chunk: TreeChunk) => compressedEncode([chunk.cursor()], context),\n\t\t);\n\t\toutputBuffer.push(chunkReferenceIds);\n\t},\n\n\tshape: new NestedArrayShape(new IncrementalChunkShape() /* innerShape */),\n};\n\n/**\n * Encode `value` with `shape` into `outputBuffer`.\n *\n * Requires that `value` is compatible with `shape`.\n */\nexport function encodeValue(\n\tvalue: Value,\n\tshape: EncodedValueShape,\n\toutputBuffer: BufferFormat,\n): void {\n\tif (shape === undefined) {\n\t\tif (value === undefined) {\n\t\t\toutputBuffer.push(false);\n\t\t} else {\n\t\t\toutputBuffer.push(true, value);\n\t\t}\n\t} else {\n\t\tif (shape === true) {\n\t\t\tassert(value !== undefined, 0x78d /* required value must not be missing */);\n\t\t\toutputBuffer.push(value);\n\t\t} else if (shape === false) {\n\t\t\tassert(value === undefined, 0x73f /* incompatible value shape: expected no value */);\n\t\t} else if (Array.isArray(shape)) {\n\t\t\tassert(shape.length === 1, 0x740 /* expected a single constant for value */);\n\t\t} else if (shape === SpecialField.Identifier) {\n\t\t\t// This case is a special case handling the encoding of identifier fields.\n\t\t\tassert(value !== undefined, 0x998 /* required value must not be missing */);\n\t\t\toutputBuffer.push(value);\n\t\t} else {\n\t\t\t// EncodedCounter case:\n\t\t\tunreachableCase(shape, \"Encoding values as deltas is not yet supported\");\n\t\t}\n\t}\n}\n\n/**\n * Provides common contextual information during encoding, like schema and policy settings.\n * Also, provides a cache to avoid duplicating equivalent shapes during a batch of encode operations.\n * @remarks\n * To avoid Shape duplication, any Shapes used in the encoding should either be:\n * - Singletons defined in a static scope.\n * - Cached in this object for future reuse such that all equivalent Shapes are deduplicated.\n */\nexport class EncoderContext implements NodeEncodeBuilder, FieldEncodeBuilder {\n\tprivate readonly nodeEncodersFromSchema: Map<TreeNodeSchemaIdentifier, NodeEncoder> =\n\t\tnew Map();\n\tprivate readonly nestedArrayEncoders: Map<NodeEncoder, NestedArrayEncoder> = new Map();\n\tpublic constructor(\n\t\tprivate readonly nodeEncoderFromPolicy: NodeEncoderPolicy,\n\t\tprivate readonly fieldEncoderFromPolicy: FieldEncoderPolicy,\n\t\tpublic readonly fieldShapes: ReadonlyMap<FieldKindIdentifier, FieldKindData>,\n\t\tpublic readonly idCompressor: IIdCompressor,\n\t\t/**\n\t\t * To be used to encode incremental chunks, if any.\n\t\t * @remarks\n\t\t * See {@link IncrementalEncoder} for more information.\n\t\t */\n\t\tpublic readonly incrementalEncoder: IncrementalEncoder | undefined,\n\t\tpublic readonly version: FieldBatchFormatVersion,\n\t) {}\n\n\tpublic nodeEncoderFromSchema(schemaName: TreeNodeSchemaIdentifier): NodeEncoder {\n\t\treturn getOrCreate(this.nodeEncodersFromSchema, schemaName, () =>\n\t\t\tthis.nodeEncoderFromPolicy(this, schemaName),\n\t\t);\n\t}\n\n\tpublic fieldEncoderFromSchema(fieldSchema: TreeFieldStoredSchema): FieldEncoder {\n\t\treturn new LazyFieldEncoder(this, fieldSchema, this.fieldEncoderFromPolicy);\n\t}\n\n\tpublic nestedArrayEncoder(inner: NodeEncoder): NestedArrayEncoder {\n\t\treturn getOrCreate(this.nestedArrayEncoders, inner, () => new NestedArrayEncoder(inner));\n\t}\n}\n\nexport interface NodeEncodeBuilder {\n\tnodeEncoderFromSchema(schemaName: TreeNodeSchemaIdentifier): NodeEncoder;\n}\n\nexport interface FieldEncodeBuilder {\n\tfieldEncoderFromSchema(schema: TreeFieldStoredSchema): FieldEncoder;\n}\n\n/**\n * The policy for building a {@link FieldEncoder} for a field.\n */\nexport type FieldEncoderPolicy = (\n\tnodeBuilder: NodeEncodeBuilder,\n\tschema: TreeFieldStoredSchema,\n) => FieldEncoder;\n\n/**\n * The policy for building a {@link NodeEncoder} for a node.\n */\nexport type NodeEncoderPolicy = (\n\tfieldBuilder: FieldEncodeBuilder,\n\tschemaName: TreeNodeSchemaIdentifier,\n) => NodeEncoder;\n\nclass LazyFieldEncoder implements FieldEncoder {\n\tprivate encoderLazy: FieldEncoder | undefined;\n\n\tpublic constructor(\n\t\tpublic readonly nodeBuilder: NodeEncodeBuilder,\n\t\tpublic readonly fieldSchema: TreeFieldStoredSchema,\n\t\tprivate readonly fieldEncoderFromPolicy: FieldEncoderPolicy,\n\t) {}\n\tpublic encodeField(\n\t\tcursor: ITreeCursorSynchronous,\n\t\tcontext: EncoderContext,\n\t\toutputBuffer: BufferFormat,\n\t): void {\n\t\tthis.encoder.encodeField(cursor, context, outputBuffer);\n\t}\n\n\tprivate get encoder(): FieldEncoder {\n\t\t// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing -- using ??= could change behavior if value is falsy\n\t\tif (this.encoderLazy === undefined) {\n\t\t\tthis.encoderLazy = this.fieldEncoderFromPolicy(this.nodeBuilder, this.fieldSchema);\n\t\t}\n\t\treturn this.encoderLazy;\n\t}\n\n\tpublic get shape(): Shape {\n\t\treturn this.encoder.shape;\n\t}\n}\n"]}
1
+ {"version":3,"file":"compressedEncode.js","sourceRoot":"","sources":["../../../../src/feature-libraries/chunked-forest/codec/compressedEncode.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,qCAAqC,CAAC;AAGpF,OAAO,EAUN,WAAW,GACX,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAGrD,OAAO,EAEN,KAAK,IAAI,YAAY,EACrB,kCAAkC,GAClC,MAAM,2BAA2B,CAAC;AAGnC,OAAO,EAMN,uBAAuB,EACvB,YAAY,GACZ,MAAM,aAAa,CAAC;AAErB;;;;;;GAMG;AACH,MAAM,UAAU,gBAAgB,CAC/B,UAAsB,EACtB,OAAuB;IAEvB,MAAM,WAAW,GAAmB,EAAE,CAAC;IAEvC,6DAA6D;IAC7D,KAAK,MAAM,MAAM,IAAI,UAAU,EAAE,CAAC;QACjC,MAA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,GAAG,EAAE,CAChE,IAAI,CAAC,qBAAqB,CAAC,IAAI,EAAE,UAAU,CAAC,CAC5C,CAAC;IACH,CAAC;IAEM,sBAAsB,CAAC,WAAkC;QAC/D,OAAO,IAAI,gBAAgB,CAAC,IAAI,EAAE,WAAW,EAAE,IAAI,CAAC,sBAAsB,CAAC,CAAC;IAC7E,CAAC;IAEM,kBAAkB,CAAC,KAAkB;QAC3C,OAAO,WAAW,CAAC,IAAI,CAAC,mBAAmB,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,IAAI,kBAAkB,CAAC,KAAK,CAAC,CAAC,CAAC;IAC1F,CAAC;CACD;AA0BD,MAAM,gBAAgB;IAGrB,YACiB,WAA8B,EAC9B,WAAkC,EACjC,sBAA0C;QAF3C,gBAAW,GAAX,WAAW,CAAmB;QAC9B,gBAAW,GAAX,WAAW,CAAuB;QACjC,2BAAsB,GAAtB,sBAAsB,CAAoB;IACzD,CAAC;IACG,WAAW,CACjB,MAA8B,EAC9B,OAAuB,EACvB,YAA0B;QAE1B,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,MAAM,EAAE,OAAO,EAAE,YAAY,CAAC,CAAC;IACzD,CAAC;IAED,IAAY,OAAO;QAClB,6HAA6H;QAC7H,IAAI,IAAI,CAAC,WAAW,KAAK,SAAS,EAAE,CAAC;YACpC,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,sBAAsB,CAAC,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;QACpF,CAAC;QACD,OAAO,IAAI,CAAC,WAAW,CAAC;IACzB,CAAC;IAED,IAAW,KAAK;QACf,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC;IAC3B,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, unreachableCase, fail } from \"@fluidframework/core-utils/internal\";\nimport type { IIdCompressor } from \"@fluidframework/id-compressor\";\n\nimport {\n\tCursorLocationType,\n\ttype FieldKey,\n\ttype FieldKindData,\n\ttype FieldKindIdentifier,\n\ttype ITreeCursorSynchronous,\n\ttype TreeChunk,\n\ttype TreeFieldStoredSchema,\n\ttype TreeNodeSchemaIdentifier,\n\ttype Value,\n\tforEachNode,\n} from \"../../../core/index.js\";\nimport { getOrCreate } from \"../../../util/index.js\";\n\nimport type { Counter, DeduplicationTable } from \"./chunkCodecUtilities.js\";\nimport {\n\ttype BufferFormat as BufferFormatGeneric,\n\tShape as ShapeGeneric,\n\tupdateShapesAndIdentifiersEncoding,\n} from \"./chunkEncodingGeneric.js\";\nimport type { IncrementalEncoder } from \"./codecs.js\";\nimport type { FieldBatch } from \"./fieldBatch.js\";\nimport {\n\ttype EncodedAnyShape,\n\ttype EncodedChunkShape,\n\ttype EncodedFieldBatch,\n\ttype EncodedNestedArrayShape,\n\ttype EncodedValueShape,\n\tFieldBatchFormatVersion,\n\tSpecialField,\n} from \"./format.js\";\n\n/**\n * Encode data from `FieldBatch` into an `EncodedFieldBatch`.\n *\n * Optimized for encoded size and encoding performance.\n *\n * Most of the compression strategy comes from the policy provided via `context`.\n */\nexport function compressedEncode(\n\tfieldBatch: FieldBatch,\n\tcontext: EncoderContext,\n): EncodedFieldBatch {\n\tconst batchBuffer: BufferFormat[] = [];\n\n\t// Populate buffer, including shape and identifier references\n\tfor (const cursor of fieldBatch) {\n\t\tconst buffer: BufferFormat = [];\n\t\tanyFieldEncoder.encodeField(cursor, context, buffer);\n\t\tbatchBuffer.push(buffer);\n\t}\n\treturn updateShapesAndIdentifiersEncoding(context.version, batchBuffer);\n}\n\nexport type BufferFormat = BufferFormatGeneric<EncodedChunkShape>;\nexport type Shape = ShapeGeneric<EncodedChunkShape>;\n\n/**\n * Like {@link FieldEncoder}, except data will be prefixed with the key.\n */\nexport interface KeyedFieldEncoder {\n\treadonly key: FieldKey;\n\treadonly encoder: FieldEncoder;\n}\n\n/**\n * An encoder with an associated shape.\n */\nexport interface Encoder {\n\t/**\n\t * The shape which describes how the encoded data is laid out.\n\t * Used by decoders to interpret the output of `encodeNode`.\n\t */\n\treadonly shape: Shape;\n}\n\n/**\n * An encoder for a specific shape of node.\n *\n * Can only be used with compatible nodes.\n */\nexport interface NodeEncoder extends Encoder {\n\t/**\n\t * @param cursor - in Nodes mode. Does not move cursor.\n\t */\n\tencodeNode(\n\t\tcursor: ITreeCursorSynchronous,\n\t\tcontext: EncoderContext,\n\t\toutputBuffer: BufferFormat,\n\t): void;\n}\n\n/**\n * Like {@link NodeEncoder}, except encodes a run of nodes.\n */\nexport interface NodesEncoder extends Encoder {\n\t/**\n\t * @param cursor - in Nodes mode. Moves cursor however many nodes it encodes.\n\t */\n\tencodeNodes(\n\t\tcursor: ITreeCursorSynchronous,\n\t\tcontext: EncoderContext,\n\t\toutputBuffer: BufferFormat,\n\t): void;\n}\n\n/**\n * Like {@link NodeEncoder}, except encodes a field.\n */\nexport interface FieldEncoder extends Encoder {\n\t/**\n\t * @param cursor - in Fields mode. Encodes entire field.\n\t */\n\tencodeField(\n\t\tcursor: ITreeCursorSynchronous,\n\t\tcontext: EncoderContext,\n\t\toutputBuffer: BufferFormat,\n\t): void;\n}\n\n/**\n * Makes a {@link FieldEncoder} which runs `encoder` on every node in the field.\n * This does not encode the number nodes: the user of this may need to encode that elsewhere.\n */\nexport function asFieldEncoder(encoder: NodeEncoder): FieldEncoder {\n\treturn {\n\t\tencodeField(\n\t\t\tcursor: ITreeCursorSynchronous,\n\t\t\tcontext: EncoderContext,\n\t\t\toutputBuffer: BufferFormat,\n\t\t): void {\n\t\t\tforEachNode(cursor, () => encoder.encodeNode(cursor, context, outputBuffer));\n\t\t},\n\t\tshape: encoder.shape,\n\t};\n}\n\n/**\n * Adapt a {@link NodeEncoder} to a {@link NodesEncoder} which invokes `encoder` once.\n */\nexport function asNodesEncoder(encoder: NodeEncoder): NodesEncoder {\n\treturn {\n\t\tencodeNodes(\n\t\t\tcursor: ITreeCursorSynchronous,\n\t\t\tcontext: EncoderContext,\n\t\t\toutputBuffer: BufferFormat,\n\t\t): void {\n\t\t\tencoder.encodeNode(cursor, context, outputBuffer);\n\t\t\tcursor.nextNode();\n\t\t},\n\t\tshape: encoder.shape,\n\t};\n}\n\n/**\n * Encodes a chunk with {@link EncodedAnyShape} by prefixing the data with its shape.\n */\nexport class AnyShape extends ShapeGeneric<EncodedChunkShape> {\n\tprivate constructor() {\n\t\tsuper();\n\t}\n\tpublic static readonly instance = new AnyShape();\n\n\tpublic encodeShape(\n\t\tidentifiers: DeduplicationTable<string>,\n\t\tshapes: DeduplicationTable<Shape>,\n\t): EncodedChunkShape {\n\t\tconst encodedAnyShape: EncodedAnyShape = 0;\n\t\treturn { d: encodedAnyShape };\n\t}\n\n\tpublic countReferencedShapesAndIdentifiers(\n\t\tidentifiers: Counter<string>,\n\t\tshapeDiscovered: (shape: Shape) => void,\n\t): void {}\n\n\tpublic static encodeField(\n\t\tcursor: ITreeCursorSynchronous,\n\t\tcontext: EncoderContext,\n\t\toutputBuffer: BufferFormat,\n\t\tencoder: FieldEncoder,\n\t): void {\n\t\toutputBuffer.push(encoder.shape);\n\t\tencoder.encodeField(cursor, context, outputBuffer);\n\t}\n\n\tpublic static encodeNode(\n\t\tcursor: ITreeCursorSynchronous,\n\t\tcontext: EncoderContext,\n\t\toutputBuffer: BufferFormat,\n\t\tencoder: NodeEncoder,\n\t): void {\n\t\toutputBuffer.push(encoder.shape);\n\t\tencoder.encodeNode(cursor, context, outputBuffer);\n\t}\n\n\tpublic static encodeNodes(\n\t\tcursor: ITreeCursorSynchronous,\n\t\tcontext: EncoderContext,\n\t\toutputBuffer: BufferFormat,\n\t\tencoder: NodesEncoder,\n\t): void {\n\t\toutputBuffer.push(encoder.shape);\n\t\tencoder.encodeNodes(cursor, context, outputBuffer);\n\t}\n}\n\n/**\n * Encodes a single node polymorphically.\n */\nexport const anyNodeEncoder: NodeEncoder = {\n\tencodeNode(\n\t\tcursor: ITreeCursorSynchronous,\n\t\tcontext: EncoderContext,\n\t\toutputBuffer: BufferFormat,\n\t): void {\n\t\t// TODO: Fast path uniform chunk content.\n\t\tconst nodeEncoder = context.nodeEncoderFromSchema(cursor.type);\n\t\tAnyShape.encodeNode(cursor, context, outputBuffer, nodeEncoder);\n\t},\n\n\tshape: AnyShape.instance,\n};\n\n/**\n * Encodes a field polymorphically.\n */\nexport const anyFieldEncoder: FieldEncoder = {\n\tencodeField(\n\t\tcursor: ITreeCursorSynchronous,\n\t\tcontext: EncoderContext,\n\t\toutputBuffer: BufferFormat,\n\t): void {\n\t\t// TODO: Fast path uniform chunks.\n\n\t\tif (cursor.getFieldLength() === 0) {\n\t\t\tconst shape = InlineArrayEncoder.empty;\n\t\t\tAnyShape.encodeField(cursor, context, outputBuffer, shape);\n\t\t} else if (cursor.getFieldLength() === 1) {\n\t\t\t// Fast path chunk of size one size one at least: skip nested array.\n\t\t\tcursor.enterNode(0);\n\t\t\tanyNodeEncoder.encodeNode(cursor, context, outputBuffer);\n\t\t\tcursor.exitNode();\n\t\t} else {\n\t\t\t// TODO: more efficient encoding for common cases.\n\t\t\t// Could try to find more specific shape compatible with all children than `anyNodeEncoder`.\n\n\t\t\tconst shape = context.nestedArrayEncoder(anyNodeEncoder);\n\t\t\tAnyShape.encodeField(cursor, context, outputBuffer, shape);\n\t\t}\n\t},\n\n\tshape: AnyShape.instance,\n};\n\n/**\n * Encodes a chunk using {@link EncodedInlineArrayShape}.\n * @remarks\n * The fact this is also a Shape is an implementation detail of the encoder: that allows the shape it uses to be itself,\n * which is an easy way to keep all the related code together without extra objects.\n */\nexport class InlineArrayEncoder\n\textends ShapeGeneric<EncodedChunkShape>\n\timplements NodesEncoder, FieldEncoder\n{\n\tpublic static readonly empty: InlineArrayEncoder = new InlineArrayEncoder(0, {\n\t\tget shape() {\n\t\t\t// Not actually used, makes count work without adding an additional shape.\n\t\t\treturn InlineArrayEncoder.empty;\n\t\t},\n\t\tencodeNodes(\n\t\t\tcursor: ITreeCursorSynchronous,\n\t\t\tcontext: EncoderContext,\n\t\t\toutputBuffer: BufferFormat,\n\t\t): void {\n\t\t\tfail(0xb4d /* Empty array should not encode any nodes */);\n\t\t},\n\t});\n\n\t/**\n\t * @param length - number of invocations of `inner`.\n\t */\n\tpublic constructor(\n\t\tpublic readonly length: number,\n\t\tpublic readonly inner: NodesEncoder,\n\t) {\n\t\tsuper();\n\t}\n\n\tpublic encodeNodes(\n\t\tcursor: ITreeCursorSynchronous,\n\t\tcontext: EncoderContext,\n\t\toutputBuffer: BufferFormat,\n\t): void {\n\t\t// Linter is wrong about this loop being for-of compatible.\n\t\t// eslint-disable-next-line @typescript-eslint/prefer-for-of\n\t\tfor (let index = 0; index < this.length; index++) {\n\t\t\tthis.inner.encodeNodes(cursor, context, outputBuffer);\n\t\t}\n\t}\n\n\tpublic encodeField(\n\t\tcursor: ITreeCursorSynchronous,\n\t\tcontext: EncoderContext,\n\t\toutputBuffer: BufferFormat,\n\t): void {\n\t\t// Its possible individual items from this array encode multiple nodes, so don't assume === here.\n\t\tassert(\n\t\t\tcursor.getFieldLength() >= this.length,\n\t\t\t0x73c /* unexpected length for fixed length array */,\n\t\t);\n\t\tcursor.firstNode();\n\t\tthis.encodeNodes(cursor, context, outputBuffer);\n\t\tassert(\n\t\t\tcursor.mode === CursorLocationType.Fields,\n\t\t\t0x73d /* should return to fields mode when finished encoding */,\n\t\t);\n\t}\n\n\tpublic encodeShape(\n\t\tidentifiers: DeduplicationTable<string>,\n\t\tshapes: DeduplicationTable<Shape>,\n\t): EncodedChunkShape {\n\t\treturn {\n\t\t\tb: {\n\t\t\t\tlength: this.length,\n\t\t\t\tshape: shapes.valueToIndex.get(this.inner.shape) ?? fail(0xb4e /* missing shape */),\n\t\t\t},\n\t\t};\n\t}\n\n\tpublic countReferencedShapesAndIdentifiers(\n\t\tidentifiers: Counter<string>,\n\t\tshapeDiscovered: (shape: Shape) => void,\n\t): void {\n\t\tshapeDiscovered(this.inner.shape);\n\t}\n\n\tpublic get shape(): this {\n\t\treturn this;\n\t}\n}\n\n/**\n * Encodes the shape for a nested array as {@link EncodedNestedArrayShape} shape.\n */\nexport class NestedArrayShape extends ShapeGeneric<EncodedChunkShape> {\n\t/**\n\t * @param innerShape - The shape of each item in this nested array.\n\t */\n\tpublic constructor(public readonly innerShape: Shape) {\n\t\tsuper();\n\t}\n\n\tpublic encodeShape(\n\t\tidentifiers: DeduplicationTable<string>,\n\t\tshapes: DeduplicationTable<Shape>,\n\t): EncodedChunkShape {\n\t\tconst shape: EncodedNestedArrayShape =\n\t\t\tshapes.valueToIndex.get(this.innerShape) ??\n\t\t\tfail(0xb4f /* index for shape not found in table */);\n\t\treturn {\n\t\t\ta: shape,\n\t\t};\n\t}\n\n\tpublic countReferencedShapesAndIdentifiers(\n\t\tidentifiers: Counter<string>,\n\t\tshapeDiscovered: (shape: Shape) => void,\n\t): void {\n\t\tshapeDiscovered(this.innerShape);\n\t}\n}\n\n/**\n * Encodes a field as a nested array with the {@link EncodedNestedArrayShape} shape.\n * @remarks\n * The fact this is also exposes a Shape is an implementation detail: it allows the shape it uses to be itself\n * which is an easy way to keep all the related code together without extra objects.\n */\nexport class NestedArrayEncoder implements FieldEncoder {\n\tpublic constructor(\n\t\tpublic readonly innerEncoder: NodeEncoder,\n\t\tpublic readonly shape: NestedArrayShape = new NestedArrayShape(innerEncoder.shape),\n\t) {}\n\n\tpublic encodeField(\n\t\tcursor: ITreeCursorSynchronous,\n\t\tcontext: EncoderContext,\n\t\toutputBuffer: BufferFormat,\n\t): void {\n\t\tconst buffer: BufferFormat = [];\n\t\tlet allNonZeroSize = true;\n\t\tconst length = cursor.getFieldLength();\n\t\tforEachNode(cursor, () => {\n\t\t\tconst before = buffer.length;\n\t\t\tthis.innerEncoder.encodeNode(cursor, context, buffer);\n\t\t\tallNonZeroSize &&= buffer.length - before !== 0;\n\t\t});\n\t\tif (buffer.length === 0) {\n\t\t\t// This relies on the number of inner chunks being the same as the number of nodes.\n\t\t\t// If making inner a `NodesEncoder`, this code will have to be adjusted accordingly.\n\t\t\toutputBuffer.push(length);\n\t\t} else {\n\t\t\tassert(\n\t\t\t\tallNonZeroSize,\n\t\t\t\t0x73e /* either all or none of the members of a nested array must be 0 sized, or there is no way the decoder could process the content correctly. */,\n\t\t\t);\n\t\t\toutputBuffer.push(buffer);\n\t\t}\n\t}\n}\n\n/**\n * Encodes the shape for an incremental chunk as {@link EncodedIncrementalChunkShape} shape.\n */\nexport class IncrementalChunkShape extends ShapeGeneric<EncodedChunkShape> {\n\tpublic encodeShape(\n\t\tidentifiers: DeduplicationTable<string>,\n\t\tshapes: DeduplicationTable<Shape>,\n\t): EncodedChunkShape {\n\t\treturn {\n\t\t\te: 0 /* EncodedIncrementalChunkShape */,\n\t\t};\n\t}\n\n\tpublic countReferencedShapesAndIdentifiers(\n\t\tidentifiers: Counter<string>,\n\t\tshapeDiscovered: (shape: Shape) => void,\n\t): void {}\n\n\tpublic get shape(): this {\n\t\treturn this;\n\t}\n}\n\n/**\n * Encodes an incremental field whose tree chunks are encoded separately and referenced by their {@link ChunkReferenceId}.\n * The shape of the content of this field is {@link NestedArrayShape}.\n * The inner items of the array have shape {@link IncrementalChunkShape} and are {@link ChunkReferenceId}s\n * of the encoded chunks.\n */\nexport const incrementalFieldEncoder: FieldEncoder = {\n\tencodeField(\n\t\tcursor: ITreeCursorSynchronous,\n\t\tcontext: EncoderContext,\n\t\toutputBuffer: BufferFormat,\n\t): void {\n\t\tassert(\n\t\t\tcontext.incrementalEncoder !== undefined,\n\t\t\t0xc88 /* incremental encoder must be defined to use incrementalFieldEncoder */,\n\t\t);\n\t\tassert(\n\t\t\tcontext.version >= FieldBatchFormatVersion.v2,\n\t\t\t0xca1 /* Unsupported FieldBatchFormatVersion for incremental encoding; must be v2 or higher */,\n\t\t);\n\n\t\tconst chunkReferenceIds = context.incrementalEncoder.encodeIncrementalField(\n\t\t\tcursor,\n\t\t\t(chunk: TreeChunk) => compressedEncode([chunk.cursor()], context),\n\t\t);\n\t\toutputBuffer.push(chunkReferenceIds);\n\t},\n\n\tshape: new NestedArrayShape(new IncrementalChunkShape() /* innerShape */),\n};\n\n/**\n * Encode `value` with `shape` into `outputBuffer`.\n *\n * Requires that `value` is compatible with `shape`.\n */\nexport function encodeValue(\n\tvalue: Value,\n\tshape: EncodedValueShape,\n\toutputBuffer: BufferFormat,\n): void {\n\tif (shape === undefined) {\n\t\tif (value === undefined) {\n\t\t\toutputBuffer.push(false);\n\t\t} else {\n\t\t\toutputBuffer.push(true, value);\n\t\t}\n\t} else {\n\t\tif (shape === true) {\n\t\t\tassert(value !== undefined, 0x78d /* required value must not be missing */);\n\t\t\toutputBuffer.push(value);\n\t\t} else if (shape === false) {\n\t\t\tassert(value === undefined, 0x73f /* incompatible value shape: expected no value */);\n\t\t} else if (Array.isArray(shape)) {\n\t\t\tassert(shape.length === 1, 0x740 /* expected a single constant for value */);\n\t\t} else if (shape === SpecialField.Identifier) {\n\t\t\t// This case is a special case handling the encoding of identifier fields.\n\t\t\tassert(value !== undefined, 0x998 /* required value must not be missing */);\n\t\t\toutputBuffer.push(value);\n\t\t} else {\n\t\t\t// EncodedCounter case:\n\t\t\tunreachableCase(shape, \"Encoding values as deltas is not yet supported\");\n\t\t}\n\t}\n}\n\n/**\n * Provides common contextual information during encoding, like schema and policy settings.\n * Also, provides a cache to avoid duplicating equivalent shapes during a batch of encode operations.\n * @remarks\n * To avoid Shape duplication, any Shapes used in the encoding should either be:\n * - Singletons defined in a static scope.\n * - Cached in this object for future reuse such that all equivalent Shapes are deduplicated.\n */\nexport class EncoderContext implements NodeEncodeBuilder, FieldEncodeBuilder {\n\tprivate readonly nodeEncodersFromSchema: Map<TreeNodeSchemaIdentifier, NodeEncoder> =\n\t\tnew Map();\n\tprivate readonly nestedArrayEncoders: Map<NodeEncoder, NestedArrayEncoder> = new Map();\n\tpublic constructor(\n\t\tprivate readonly nodeEncoderFromPolicy: NodeEncoderPolicy,\n\t\tprivate readonly fieldEncoderFromPolicy: FieldEncoderPolicy,\n\t\tpublic readonly fieldShapes: ReadonlyMap<FieldKindIdentifier, FieldKindData>,\n\t\tpublic readonly idCompressor: IIdCompressor,\n\t\t/**\n\t\t * To be used to encode incremental chunks, if any.\n\t\t * @remarks\n\t\t * See {@link IncrementalEncoder} for more information.\n\t\t */\n\t\tpublic readonly incrementalEncoder: IncrementalEncoder | undefined,\n\t\tpublic readonly version: FieldBatchFormatVersion,\n\t) {}\n\n\tpublic nodeEncoderFromSchema(schemaName: TreeNodeSchemaIdentifier): NodeEncoder {\n\t\treturn getOrCreate(this.nodeEncodersFromSchema, schemaName, () =>\n\t\t\tthis.nodeEncoderFromPolicy(this, schemaName),\n\t\t);\n\t}\n\n\tpublic fieldEncoderFromSchema(fieldSchema: TreeFieldStoredSchema): FieldEncoder {\n\t\treturn new LazyFieldEncoder(this, fieldSchema, this.fieldEncoderFromPolicy);\n\t}\n\n\tpublic nestedArrayEncoder(inner: NodeEncoder): NestedArrayEncoder {\n\t\treturn getOrCreate(this.nestedArrayEncoders, inner, () => new NestedArrayEncoder(inner));\n\t}\n}\n\nexport interface NodeEncodeBuilder {\n\tnodeEncoderFromSchema(schemaName: TreeNodeSchemaIdentifier): NodeEncoder;\n}\n\nexport interface FieldEncodeBuilder {\n\tfieldEncoderFromSchema(schema: TreeFieldStoredSchema): FieldEncoder;\n}\n\n/**\n * The policy for building a {@link FieldEncoder} for a field.\n */\nexport type FieldEncoderPolicy = (\n\tnodeBuilder: NodeEncodeBuilder,\n\tschema: TreeFieldStoredSchema,\n) => FieldEncoder;\n\n/**\n * The policy for building a {@link NodeEncoder} for a node.\n */\nexport type NodeEncoderPolicy = (\n\tfieldBuilder: FieldEncodeBuilder,\n\tschemaName: TreeNodeSchemaIdentifier,\n) => NodeEncoder;\n\nclass LazyFieldEncoder implements FieldEncoder {\n\tprivate encoderLazy: FieldEncoder | undefined;\n\n\tpublic constructor(\n\t\tpublic readonly nodeBuilder: NodeEncodeBuilder,\n\t\tpublic readonly fieldSchema: TreeFieldStoredSchema,\n\t\tprivate readonly fieldEncoderFromPolicy: FieldEncoderPolicy,\n\t) {}\n\tpublic encodeField(\n\t\tcursor: ITreeCursorSynchronous,\n\t\tcontext: EncoderContext,\n\t\toutputBuffer: BufferFormat,\n\t): void {\n\t\tthis.encoder.encodeField(cursor, context, outputBuffer);\n\t}\n\n\tprivate get encoder(): FieldEncoder {\n\t\t// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing -- using ??= could change behavior if value is falsy\n\t\tif (this.encoderLazy === undefined) {\n\t\t\tthis.encoderLazy = this.fieldEncoderFromPolicy(this.nodeBuilder, this.fieldSchema);\n\t\t}\n\t\treturn this.encoderLazy;\n\t}\n\n\tpublic get shape(): Shape {\n\t\treturn this.encoder.shape;\n\t}\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../../../src/feature-libraries/chunked-forest/codec/format.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,KAAK,MAAM,EAAQ,MAAM,mBAAmB,CAAC;AAUtD,OAAO,EAAc,KAAK,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAEjE;;GAEG;AACH,eAAO,MAAM,uBAAuB;;;CAGlC,CAAC;AACH,MAAM,MAAM,uBAAuB,GAAG,MAAM,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAI7E,eAAO,MAAM,aAAa,kJAAuD,CAAC;AAElF;;;GAGG;AACH,eAAO,MAAM,uBAAuB,qCAAa,CAAC;AAElD;;GAEG;AACH,eAAO,MAAM,uBAAuB;;IAGlC;;OAEG;;EAIJ,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,eAAe,yCAAkB,CAAC;AAE/C;;;GAGG;AACH,eAAO,MAAM,4BAA4B,yCAAkB,CAAC;AAE5D;;;GAGG;AACH,eAAO,MAAM,iBAAiB,2LAS5B,CAAC;AAEH,MAAM,MAAM,iBAAiB,GAAG,MAAM,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAEjE,aA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ldBatchGeneric, IdentifierOrIndex, ShapeIndex, } from "./formatGeneric.js";
8
7
  import { strictEnum } from "../../../util/index.js";
8
+ import { Count, EncodedFieldBatchGeneric, IdentifierOrIndex, ShapeIndex, } from "./formatGeneric.js";
9
9
  /**
10
10
  * The format version for the field batch.
11
11
  */
@@ -1 +1 @@
1
- {"version":3,"file":"format.js","sourceRoot":"","sources":["../../../../src/feature-libraries/chunked-forest/codec/format.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAe,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAEtD,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAEvD,OAAO,EACN,KAAK,EACL,wBAAwB,EACxB,iBAAiB,EACjB,UAAU,GACV,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,UAAU,EAAe,MAAM,wBAAwB,CAAC;AAEjE;;GAEG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,UAAU,CAAC,yBAAyB,EAAE;IAC5E,EAAE,EAAE,CAAC;IACL,EAAE,EAAE,CAAC;CACL,CAAC,CAAC;AAGH,0DAA0D;AAC1D,mEAAmE;AACnE,MAAM,CAAC,MAAM,aAAa,GAAG,IAAI,GAAG,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,uBAAuB,CAAC,CAAC,CAAC,CAAC;AAElF;;;GAGG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,UAAU,CAAC;AAElD;;GAEG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,IAAI,CAAC,MAAM,CACjD;IACC,MAAM,EAAE,KAAK;IACb;;OAEG;IACH,KAAK,EAAE,UAAU;CACjB,EACD,EAAE,oBAAoB,EAAE,KAAK,EAAE,CAC/B,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;AAE/C;;;GAGG;AACH,MAAM,CAAC,MAAM,4BAA4B,G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["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { type Static, Type } from \"@sinclair/typebox\";\n\nimport { unionOptions } from \"../../../codec/index.js\";\n\nimport {\n\tCount,\n\tEncodedFieldBatchGeneric,\n\tIdentifierOrIndex,\n\tShapeIndex,\n} from \"./formatGeneric.js\";\nimport { strictEnum, type Values } from \"../../../util/index.js\";\n\n/**\n * The format version for the field batch.\n */\nexport const FieldBatchFormatVersion = strictEnum(\"FieldBatchFormatVersion\", {\n\tv1: 1,\n\tv2: 2,\n});\nexport type FieldBatchFormatVersion = Values<typeof FieldBatchFormatVersion>;\n\n// Compatible versions used for format/version validation.\n// TODO: A proper version update policy will need to be documented.\nexport const validVersions = new Set([...Object.values(FieldBatchFormatVersion)]);\n\n/**\n * Top level length is implied from length of data array.\n * All content are of this shape.\n */\nexport const EncodedNestedArrayShape = ShapeIndex;\n\n/**\n * Inline array.\n */\nexport const EncodedInlineArrayShape = Type.Object(\n\t{\n\t\tlength: Count,\n\t\t/**\n\t\t * All entries are this shape.\n\t\t */\n\t\tshape: ShapeIndex,\n\t},\n\t{ additionalProperties: false },\n);\n\n/**\n * Encoded as `shape, ...[data for shape]`.\n *\n * Used for polymorphism.\n */\nexport const EncodedAnyShape = Type.Literal(0);\n\n/**\n * Encoded content is a {@link ChunkReferenceId}.\n * This represents the shape of a chunk that is encoded separately and is referenced by its {@link ChunkReferenceId}.\n */\nexport const EncodedIncrementalChunkShape = Type.Literal(0);\n\n/**\n * Content of the encoded field is specified by the Shape referenced by the ShapeIndex.\n * This is a tuple for conciseness.\n */\nexport const EncodedFieldShape = Type.Tuple([\n\t/**\n\t * Field key for this field.\n\t */\n\tIdentifierOrIndex,\n\t/**\n\t * Shape of data in this field.\n\t */\n\tShapeIndex,\n]);\n\nexport type EncodedFieldShape = Static<typeof EncodedFieldShape>;\n\nenum CounterRelativeTo {\n\t// Relative to previous node of same type in depth first pre-order traversal.\n\tPreviousNodeOfType_DepthFirstPreOrder,\n\t// TODO: add alternative relative mode relative to previous note at a path to allow delta encoded sequences (like points where x and y are delta encoded relative to previous points).\n}\n\nenum CounterMode {\n\tNumber,\n\t// TODO: document wrap modes and bit skipping. Note UUID subVersion here (ex: UUIDv4)\n\tUUID,\n}\n\n/**\n * Delta encoded value relative to a previous node's value.\n */\nexport const EncodedCounter = Type.Object(\n\t{\n\t\trelativeTo: Type.Enum(CounterRelativeTo),\n\t\t// If not provided, delta inline in data.\n\t\tdelta: Type.Optional(Type.Number()),\n\t\tmode: Type.Enum(CounterMode),\n\t},\n\t{ additionalProperties: false },\n);\n\n/**\n * Used in {@link EncodedValueShape} for special field kind handling.\n */\nexport enum SpecialField {\n\t/**\n\t * Special case for Identifier field kind.\n\t */\n\tIdentifier = 0,\n}\n\n/**\n * Shape of a value on a node.\n *\n * Due to limitations of TypeBox and differences between JavaScript objects, TypeScript types and JSON,\n * the case where no information about the value is captured in the shape is a bit confusing.\n * In TypeBox this is allowed by the user of this type putting it in an optional property.\n * In TypeScript it is modeled using `undefined`.\n * In JavaScript the property may be missing or explicitly `undefined`.\n * In JSON this will serialize as the property being omitted.\n * In this case, the value will be encoded as either:\n * - `false` (when there is no value) OR\n * - `true, value` when there is a value.\n *\n * For a more compact encoding, there are 4 options for the shape:\n * - `true`: there is a value, and it will simply be encoded by putting it in the output buffer (so `value`).\n * - `false`: there is never a value, and it takes up no space in the output buffer.\n * - `[value]`: there is a value, and its always the same.\n * - `SpecialField.Identifier`: special case for node identifier handling.\n * Takes up no space in the output buffer: the value comes from the shape arrays's content.\n * It is wrapped in an array to differentiate value shape types.\n *\n * In the future other value shape formats may be added, likely as objects.\n *\n * @remarks\n * See {@link EncodedNodeShape} for usage.\n */\nexport const EncodedValueShape = Type.Union([\n\tType.Boolean(),\n\tType.Array(Type.Any(), { minItems: 1, maxItems: 1 }),\n\tType.Enum(SpecialField),\n\t// TODO: support delta encoding and/or special node identifier handling\n\t// EncodedCounter,\n]);\nexport type EncodedValueShape = undefined | Static<typeof EncodedValueShape>;\n\nexport const EncodedNodeShape = Type.Object(\n\t{\n\t\t/**\n\t\t * If not provided, inlined in data.\n\t\t */\n\t\ttype: Type.Optional(IdentifierOrIndex),\n\t\tvalue: Type.Optional(EncodedValueShape),\n\t\t/**\n\t\t * Fields with fixed (per key) shapes.\n\t\t * They are encoded in the order they are specified here.\n\t\t * To ensure the order is preserved, this is an array instead of an object with keys.\n\t\t */\n\t\tfields: Type.Optional(Type.Array(EncodedFieldShape)),\n\t\t/**\n\t\t * If undefined, no data. Otherwise, nested array of `[key, ...data]*`\n\t\t * Covers any fields beyond those in `fields`.\n\t\t */\n\t\textraFields: Type.Optional(ShapeIndex),\n\t},\n\t{ additionalProperties: false },\n);\n\n/**\n * Discriminated union that represents the shapes of chunks in the encoded data.\n * \"Chunk\" here refers to a chunk of tree data, rooted at a range of nodes, that is encoded as a\n * single unit in a specific format represented by one of the shapes in this union.\n *\n * The concept of \"chunk\" is same for the tree data in memory and in the encoded wire format.\n * The physical representation of the chunk may differ, but the logical structure remains the same.\n * This is similar to other such concepts in the system.\n *\n * See {@link DiscriminatedUnionDispatcher} for more information on this pattern.\n */\nexport const EncodedChunkShape = Type.Object(\n\t{\n\t\t/**\n\t\t * {@link EncodedNestedArrayShape} union member.\n\t\t */\n\t\ta: Type.Optional(EncodedNestedArrayShape),\n\t\t/**\n\t\t * {@link EncodedInlineArrayShape} union member.\n\t\t */\n\t\tb: Type.Optional(EncodedInlineArrayShape),\n\t\t/**\n\t\t * {@link EncodedNodeShape} union member.\n\t\t */\n\t\tc: Type.Optional(EncodedNodeShape),\n\t\t/**\n\t\t * {@link EncodedAnyShape} union member.\n\t\t */\n\t\td: Type.Optional(EncodedAnyShape),\n\t\t/**\n\t\t * {@link EncodedIncrementalChunkShape} union member.\n\t\t */\n\t\te: Type.Optional(EncodedIncrementalChunkShape),\n\t},\n\tunionOptions,\n);\n\nexport type EncodedChunkShape = Static<typeof EncodedChunkShape>;\n\nexport type EncodedNestedArrayShape = Static<typeof EncodedNestedArrayShape>;\nexport type EncodedInlineArrayShape = Static<typeof EncodedInlineArrayShape>;\nexport type EncodedNodeShape = Static<typeof EncodedNodeShape>;\nexport type EncodedAnyShape = Static<typeof EncodedAnyShape>;\nexport type EncodedIncrementalChunkShape = Static<typeof EncodedIncrementalChunkShape>;\n\nexport const EncodedFieldBatchV1 = EncodedFieldBatchGeneric(\n\tFieldBatchFormatVersion.v1,\n\tEncodedChunkShape,\n);\nexport type EncodedFieldBatchV1 = Static<typeof EncodedFieldBatchV1>;\n\nexport const EncodedFieldBatchV2 = EncodedFieldBatchGeneric(\n\tFieldBatchFormatVersion.v2,\n\tEncodedChunkShape,\n);\nexport type EncodedFieldBatchV2 = Static<typeof EncodedFieldBatchV2>;\n\nexport const EncodedFieldBatch = Type.Union([EncodedFieldBatchV1, EncodedFieldBatchV2]);\nexport type EncodedFieldBatch = Static<typeof EncodedFieldBatch>;\n"]}
1
+ {"version":3,"file":"format.js","sourceRoot":"","sources":["../../../../src/feature-libraries/chunked-forest/codec/format.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAe,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAEtD,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,UAAU,EAAe,MAAM,wBAAwB,CAAC;AAEjE,OAAO,EACN,KAAK,EACL,wBAAwB,EACxB,iBAAiB,EACjB,UAAU,GACV,MAAM,oBAAoB,CAAC;AAE5B;;GAEG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,UAAU,CAAC,yBAAyB,EAAE;IAC5E,EAAE,EAAE,CAAC;IACL,EAAE,EAAE,CAAC;CACL,CAAC,CAAC;AAGH,0DAA0D;AAC1D,mEAAmE;AACnE,MAAM,CAAC,MAAM,aAAa,GAAG,IAAI,GAAG,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,uBAAuB,CAAC,CAAC,CAAC,CAAC;AAElF;;;GAG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,QAAQ,CAAC,4BAA4B,CAAC;CAC9C,EACD,YAAY,CACZ,CAAC;AAUF,MAAM,CAAC,MAAM,mBAAmB,GAAG,wBAAwB,CAC1D,uBAAuB,CAAC,EAAE,EAC1B,iBAAiB,CACjB,CAAC;AAGF,MAAM,CAAC,MAAM,mBAAmB,GAAG,wBAAwB,CAC1D,uBAAuB,CAAC,EAAE,EAC1B,iBAAiB,CACjB,CAAC;AAGF,MAAM,CAAC,MAAM,iBAAiB,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,mBAAmB,EAAE,mBAAmB,CAAC,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { type Static, Type } from \"@sinclair/typebox\";\n\nimport { unionOptions } from \"../../../codec/index.js\";\nimport { strictEnum, type Values } from \"../../../util/index.js\";\n\nimport {\n\tCount,\n\tEncodedFieldBatchGeneric,\n\tIdentifierOrIndex,\n\tShapeIndex,\n} from \"./formatGeneric.js\";\n\n/**\n * The format version for the field batch.\n */\nexport const FieldBatchFormatVersion = strictEnum(\"FieldBatchFormatVersion\", {\n\tv1: 1,\n\tv2: 2,\n});\nexport type FieldBatchFormatVersion = Values<typeof FieldBatchFormatVersion>;\n\n// Compatible versions used for format/version validation.\n// TODO: A proper version update policy will need to be documented.\nexport const validVersions = new Set([...Object.values(FieldBatchFormatVersion)]);\n\n/**\n * Top level length is implied from length of data array.\n * All content are of this shape.\n */\nexport const EncodedNestedArrayShape = ShapeIndex;\n\n/**\n * Inline array.\n */\nexport const EncodedInlineArrayShape = Type.Object(\n\t{\n\t\tlength: Count,\n\t\t/**\n\t\t * All entries are this shape.\n\t\t */\n\t\tshape: ShapeIndex,\n\t},\n\t{ additionalProperties: false },\n);\n\n/**\n * Encoded as `shape, ...[data for shape]`.\n *\n * Used for polymorphism.\n */\nexport const EncodedAnyShape = Type.Literal(0);\n\n/**\n * Encoded content is a {@link ChunkReferenceId}.\n * This represents the shape of a chunk that is encoded separately and is referenced by its {@link ChunkReferenceId}.\n */\nexport const EncodedIncrementalChunkShape = Type.Literal(0);\n\n/**\n * Content of the encoded field is specified by the Shape referenced by the ShapeIndex.\n * This is a tuple for conciseness.\n */\nexport const EncodedFieldShape = Type.Tuple([\n\t/**\n\t * Field key for this field.\n\t */\n\tIdentifierOrIndex,\n\t/**\n\t * Shape of data in this field.\n\t */\n\tShapeIndex,\n]);\n\nexport type EncodedFieldShape = Static<typeof EncodedFieldShape>;\n\nenum CounterRelativeTo {\n\t// Relative to previous node of same type in depth first pre-order traversal.\n\tPreviousNodeOfType_DepthFirstPreOrder,\n\t// TODO: add alternative relative mode relative to previous note at a path to allow delta encoded sequences (like points where x and y are delta encoded relative to previous points).\n}\n\nenum CounterMode {\n\tNumber,\n\t// TODO: document wrap modes and bit skipping. Note UUID subVersion here (ex: UUIDv4)\n\tUUID,\n}\n\n/**\n * Delta encoded value relative to a previous node's value.\n */\nexport const EncodedCounter = Type.Object(\n\t{\n\t\trelativeTo: Type.Enum(CounterRelativeTo),\n\t\t// If not provided, delta inline in data.\n\t\tdelta: Type.Optional(Type.Number()),\n\t\tmode: Type.Enum(CounterMode),\n\t},\n\t{ additionalProperties: false },\n);\n\n/**\n * Used in {@link EncodedValueShape} for special field kind handling.\n */\nexport enum SpecialField {\n\t/**\n\t * Special case for Identifier field kind.\n\t */\n\tIdentifier = 0,\n}\n\n/**\n * Shape of a value on a node.\n *\n * Due to limitations of TypeBox and differences between JavaScript objects, TypeScript types and JSON,\n * the case where no information about the value is captured in the shape is a bit confusing.\n * In TypeBox this is allowed by the user of this type putting it in an optional property.\n * In TypeScript it is modeled using `undefined`.\n * In JavaScript the property may be missing or explicitly `undefined`.\n * In JSON this will serialize as the property being omitted.\n * In this case, the value will be encoded as either:\n * - `false` (when there is no value) OR\n * - `true, value` when there is a value.\n *\n * For a more compact encoding, there are 4 options for the shape:\n * - `true`: there is a value, and it will simply be encoded by putting it in the output buffer (so `value`).\n * - `false`: there is never a value, and it takes up no space in the output buffer.\n * - `[value]`: there is a value, and its always the same.\n * - `SpecialField.Identifier`: special case for node identifier handling.\n * Takes up no space in the output buffer: the value comes from the shape arrays's content.\n * It is wrapped in an array to differentiate value shape types.\n *\n * In the future other value shape formats may be added, likely as objects.\n *\n * @remarks\n * See {@link EncodedNodeShape} for usage.\n */\nexport const EncodedValueShape = Type.Union([\n\tType.Boolean(),\n\tType.Array(Type.Any(), { minItems: 1, maxItems: 1 }),\n\tType.Enum(SpecialField),\n\t// TODO: support delta encoding and/or special node identifier handling\n\t// EncodedCounter,\n]);\nexport type EncodedValueShape = undefined | Static<typeof EncodedValueShape>;\n\nexport const EncodedNodeShape = Type.Object(\n\t{\n\t\t/**\n\t\t * If not provided, inlined in data.\n\t\t */\n\t\ttype: Type.Optional(IdentifierOrIndex),\n\t\tvalue: Type.Optional(EncodedValueShape),\n\t\t/**\n\t\t * Fields with fixed (per key) shapes.\n\t\t * They are encoded in the order they are specified here.\n\t\t * To ensure the order is preserved, this is an array instead of an object with keys.\n\t\t */\n\t\tfields: Type.Optional(Type.Array(EncodedFieldShape)),\n\t\t/**\n\t\t * If undefined, no data. Otherwise, nested array of `[key, ...data]*`\n\t\t * Covers any fields beyond those in `fields`.\n\t\t */\n\t\textraFields: Type.Optional(ShapeIndex),\n\t},\n\t{ additionalProperties: false },\n);\n\n/**\n * Discriminated union that represents the shapes of chunks in the encoded data.\n * \"Chunk\" here refers to a chunk of tree data, rooted at a range of nodes, that is encoded as a\n * single unit in a specific format represented by one of the shapes in this union.\n *\n * The concept of \"chunk\" is same for the tree data in memory and in the encoded wire format.\n * The physical representation of the chunk may differ, but the logical structure remains the same.\n * This is similar to other such concepts in the system.\n *\n * See {@link DiscriminatedUnionDispatcher} for more information on this pattern.\n */\nexport const EncodedChunkShape = Type.Object(\n\t{\n\t\t/**\n\t\t * {@link EncodedNestedArrayShape} union member.\n\t\t */\n\t\ta: Type.Optional(EncodedNestedArrayShape),\n\t\t/**\n\t\t * {@link EncodedInlineArrayShape} union member.\n\t\t */\n\t\tb: Type.Optional(EncodedInlineArrayShape),\n\t\t/**\n\t\t * {@link EncodedNodeShape} union member.\n\t\t */\n\t\tc: Type.Optional(EncodedNodeShape),\n\t\t/**\n\t\t * {@link EncodedAnyShape} union member.\n\t\t */\n\t\td: Type.Optional(EncodedAnyShape),\n\t\t/**\n\t\t * {@link EncodedIncrementalChunkShape} union member.\n\t\t */\n\t\te: Type.Optional(EncodedIncrementalChunkShape),\n\t},\n\tunionOptions,\n);\n\nexport type EncodedChunkShape = Static<typeof EncodedChunkShape>;\n\nexport type EncodedNestedArrayShape = Static<typeof EncodedNestedArrayShape>;\nexport type EncodedInlineArrayShape = Static<typeof EncodedInlineArrayShape>;\nexport type EncodedNodeShape = Static<typeof EncodedNodeShape>;\nexport type EncodedAnyShape = Static<typeof EncodedAnyShape>;\nexport type EncodedIncrementalChunkShape = Static<typeof EncodedIncrementalChunkShape>;\n\nexport const EncodedFieldBatchV1 = EncodedFieldBatchGeneric(\n\tFieldBatchFormatVersion.v1,\n\tEncodedChunkShape,\n);\nexport type EncodedFieldBatchV1 = Static<typeof EncodedFieldBatchV1>;\n\nexport const EncodedFieldBatchV2 = EncodedFieldBatchGeneric(\n\tFieldBatchFormatVersion.v2,\n\tEncodedChunkShape,\n);\nexport type EncodedFieldBatchV2 = Static<typeof EncodedFieldBatchV2>;\n\nexport const EncodedFieldBatch = Type.Union([EncodedFieldBatchV1, EncodedFieldBatchV2]);\nexport type EncodedFieldBatch = Static<typeof EncodedFieldBatch>;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"formatGeneric.d.ts","sourceRoot":"","sources":["../../../../src/feature-libraries/chunked-forest/codec/formatGeneric.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,KAAK,MAAM,EAAE,KAAK,OAAO,EAAQ,MAAM,mBAAmB,CAAC;AACpE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AAE3D;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3B,uBAAuB,SACzB,YAAY;;;;;EAalB,CAAC;AAEH,MAAM,WAAW,wBAAwB,CAAC,aAAa,CACtD,SAAQ,MAAM,CAAC,OAAO,qBAAqB,CAAC;IAC5C,MAAM,EAAE,aAAa,EAAE,CAAC;IACxB,OAAO,EAAE,uBAAuB,CAAC;CACjC"}
@@ -1 +1 @@
1
- {"version":3,"file":"formatGeneric.js","sourceRoot":"","sources":["../../../../src/feature-libraries/chunked-forest/codec/formatGeneric.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAA6B,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAGpE;;GAEG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,IAAI,CAAC,KAAK,CAAC;IAC3C,IAAI,CAAC,MAAM,EAAE;IACb,IAAI,CAAC,MAAM,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;CAC1C,CAAC,CAAC;AAGH;;;;GAIG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,IAAI,CAAC,MAAM,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC,CAAC;AAGrE,MAAM,CAAC,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC,CAAC;AAEhE,MAAM,qBAAqB,GAAG,IAAI,CAAC,MAAM,CACxC;IACC,OAAO,EAAE,IAAI,CAAC,MAAM,EAAE;IACtB,WAAW,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;IACtC;;;OAGG;IACH,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;CACxC,EACD,EAAE,oBAAoB,EAAE,KAAK,EAAE,CAC/B,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,CACvC,OAAgC,EAChC,KAAmB,EAGlB,EAAE,CACH,IAAI,CAAC,SAAS,CACb;IACC,qBAAqB;IACrB,IAAI,CAAC,MAAM,CAAC;QACX,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC;QAC9B,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC;KACzB,CAAC;CACF,EACD,EAAE,oBAAoB,EAAE,KAAK,EAAE,CAC/B,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { type Static, type TSchema, Type } from \"@sinclair/typebox\";\nimport type { FieldBatchFormatVersion } from \"./format.js\";\n\n/**\n * Identifier OR Index of an identifier in the identifier list.\n */\nexport const IdentifierOrIndex = Type.Union([\n\tType.String(),\n\tType.Number({ multipleOf: 1, minimum: 0 }),\n]);\nexport type IdentifierOrIndex = Static<typeof IdentifierOrIndex>;\n\n/**\n * Reference to a shape, by index.\n *\n * Shapes use a dictionary encoding where they are referenced by their index in a shape array.\n */\nexport const ShapeIndex = Type.Number({ multipleOf: 1, minimum: 0 });\nexport type ShapeIndex = Static<typeof ShapeIndex>;\n\nexport const Count = Type.Number({ multipleOf: 1, minimum: 0 });\n\nconst EncodedFieldBatchBase = Type.Object(\n\t{\n\t\tversion: Type.Number(),\n\t\tidentifiers: Type.Array(Type.String()),\n\t\t/**\n\t\t * Top level array is list of field from batch.\n\t\t * Inner are TreeValues mixed with indexes into \"shapes\" and nested arrays where lengths are needed.\n\t\t */\n\t\tdata: Type.Array(Type.Array(Type.Any())),\n\t},\n\t{ additionalProperties: false },\n);\n\n/**\n * Format for encoding a tree chunk.\n * @param version - format version.\n * Must be changed if the previously existing decode logic will not correctly handle the new encoding.\n * If adding a new encoding version which does not use this format,\n * this parameter should be retyped to be a union of the subset of FieldBatchFormatVersion values which this supports.\n * @param shape - schema for union of shape format, see {@link DiscriminatedUnionDispatcher}.\n */\nexport const EncodedFieldBatchGeneric = <TShapeSchema extends TSchema>(\n\tversion: FieldBatchFormatVersion,\n\tshape: TShapeSchema,\n\t// Return type is intentionally derived.\n\t// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\n) =>\n\tType.Composite(\n\t\t[\n\t\t\tEncodedFieldBatchBase,\n\t\t\tType.Object({\n\t\t\t\tversion: Type.Literal(version),\n\t\t\t\tshapes: Type.Array(shape),\n\t\t\t}),\n\t\t],\n\t\t{ additionalProperties: false },\n\t);\n\nexport interface EncodedFieldBatchGeneric<TEncodedShape>\n\textends Static<typeof EncodedFieldBatchBase> {\n\tshapes: TEncodedShape[];\n\tversion: FieldBatchFormatVersion;\n}\n"]}
1
+ {"version":3,"file":"formatGeneric.js","sourceRoot":"","sources":["../../../../src/feature-libraries/chunked-forest/codec/formatGeneric.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAA6B,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAIpE;;GAEG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,IAAI,CAAC,KAAK,CAAC;IAC3C,IAAI,CAAC,MAAM,EAAE;IACb,IAAI,CAAC,MAAM,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;CAC1C,CAAC,CAAC;AAGH;;;;GAIG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,IAAI,CAAC,MAAM,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC,CAAC;AAGrE,MAAM,CAAC,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC,CAAC;AAEhE,MAAM,qBAAqB,GAAG,IAAI,CAAC,MAAM,CACxC;IACC,OAAO,EAAE,IAAI,CAAC,MAAM,EAAE;IACtB,WAAW,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;IACtC;;;OAGG;IACH,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;CACxC,EACD,EAAE,oBAAoB,EAAE,KAAK,EAAE,CAC/B,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,CACvC,OAAgC,EAChC,KAAmB,EAGlB,EAAE,CACH,IAAI,CAAC,SAAS,CACb;IACC,qBAAqB;IACrB,IAAI,CAAC,MAAM,CAAC;QACX,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC;QAC9B,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC;KACzB,CAAC;CACF,EACD,EAAE,oBAAoB,EAAE,KAAK,EAAE,CAC/B,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { type Static, type TSchema, Type } from \"@sinclair/typebox\";\n\nimport type { FieldBatchFormatVersion } from \"./format.js\";\n\n/**\n * Identifier OR Index of an identifier in the identifier list.\n */\nexport const IdentifierOrIndex = Type.Union([\n\tType.String(),\n\tType.Number({ multipleOf: 1, minimum: 0 }),\n]);\nexport type IdentifierOrIndex = Static<typeof IdentifierOrIndex>;\n\n/**\n * Reference to a shape, by index.\n *\n * Shapes use a dictionary encoding where they are referenced by their index in a shape array.\n */\nexport const ShapeIndex = Type.Number({ multipleOf: 1, minimum: 0 });\nexport type ShapeIndex = Static<typeof ShapeIndex>;\n\nexport const Count = Type.Number({ multipleOf: 1, minimum: 0 });\n\nconst EncodedFieldBatchBase = Type.Object(\n\t{\n\t\tversion: Type.Number(),\n\t\tidentifiers: Type.Array(Type.String()),\n\t\t/**\n\t\t * Top level array is list of field from batch.\n\t\t * Inner are TreeValues mixed with indexes into \"shapes\" and nested arrays where lengths are needed.\n\t\t */\n\t\tdata: Type.Array(Type.Array(Type.Any())),\n\t},\n\t{ additionalProperties: false },\n);\n\n/**\n * Format for encoding a tree chunk.\n * @param version - format version.\n * Must be changed if the previously existing decode logic will not correctly handle the new encoding.\n * If adding a new encoding version which does not use this format,\n * this parameter should be retyped to be a union of the subset of FieldBatchFormatVersion values which this supports.\n * @param shape - schema for union of shape format, see {@link DiscriminatedUnionDispatcher}.\n */\nexport const EncodedFieldBatchGeneric = <TShapeSchema extends TSchema>(\n\tversion: FieldBatchFormatVersion,\n\tshape: TShapeSchema,\n\t// Return type is intentionally derived.\n\t// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\n) =>\n\tType.Composite(\n\t\t[\n\t\t\tEncodedFieldBatchBase,\n\t\t\tType.Object({\n\t\t\t\tversion: Type.Literal(version),\n\t\t\t\tshapes: Type.Array(shape),\n\t\t\t}),\n\t\t],\n\t\t{ additionalProperties: false },\n\t);\n\nexport interface EncodedFieldBatchGeneric<TEncodedShape>\n\textends Static<typeof EncodedFieldBatchBase> {\n\tshapes: TEncodedShape[];\n\tversion: FieldBatchFormatVersion;\n}\n"]}
@@ -4,10 +4,10 @@
4
4
  */
5
5
  import type { IIdCompressor } from "@fluidframework/id-compressor";
6
6
  import { type StoredSchemaCollection, type TreeFieldStoredSchema, type TreeNodeSchemaIdentifier, type SchemaPolicy } from "../../../core/index.js";
7
+ import type { IncrementalEncoder } from "./codecs.js";
7
8
  import { EncoderContext, type FieldEncoder, type FieldEncodeBuilder, type NodeEncodeBuilder } from "./compressedEncode.js";
8
9
  import type { FieldBatch } from "./fieldBatch.js";
9
10
  import { type EncodedFieldBatchV1, type EncodedFieldBatchV2, FieldBatchFormatVersion } from "./format.js";
10
- import type { IncrementalEncoder } from "./codecs.js";
11
11
  import { NodeShapeBasedEncoder } from "./nodeEncoder.js";
12
12
  /**
13
13
  * Encode data from `fieldBatch` in into an `EncodedChunk` using {@link FieldBatchFormatVersion.v1}.
@@ -1 +1 @@
1
- {"version":3,"file":"schemaBasedEncode.d.ts","sourceRoot":"","s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9B,KAAK,EAAE,qBAAqB,EAC5B,OAAO,EAAE,cAAc,EACvB,YAAY,EAAE,sBAAsB,GAClC,YAAY,CA8Bd;AAED;;GAEG;AACH,wBAAgB,cAAc,CAC7B,YAAY,EAAE,kBAAkB,EAChC,YAAY,EAAE,sBAAsB,EACpC,UAAU,EAAE,wBAAwB,EACpC,kBAAkB,CAAC,EAAE,kBAAkB,GACrC,qBAAqB,CA4CvB"}
1
+ {"version":3,"file":"schemaBasedEncode.d.ts","sourceRoot":"","sources":["../../../../src/feature-libraries/chunked-forest/codec/schemaBasedEncode.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAEnE,OAAO,EAIN,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,EAC1B,KAAK,wBAAwB,EAI7B,KAAK,YAAY,EACjB,MAAM,wBAAwB,CAAC;AAGhC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,EACN,cAAc,EACd,KAAK,YAAY,EACjB,KAAK,kBAAkB,EAEvB,KAAK,iBAAiB,EAKtB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAEN,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EAExB,uBAAuB,EAEvB,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAEzD;;;;GAIG;AACH,wBAAgB,wBAAwB,CACvC,MAAM,EAAE,sBAAsB,EAC9B,MAAM,EAAE,YAAY,EACpB,UAAU,EAAE,UAAU,EACtB,YAAY,EAAE,aAAa,GACzB,mBAAmB,CASrB;AAED;;;;GAIG;AACH,wBAAgB,wBAAwB,CACvC,MAAM,EAAE,sBAAsB,EAC9B,MAAM,EAAE,YAAY,EACpB,UAAU,EAAE,UAAU,EACtB,YAAY,EAAE,aAAa,EAC3B,kBAAkB,EAAE,kBAAkB,GAAG,SAAS,GAChD,mBAAmB,CASrB;AA0BD,wBAAgB,YAAY,CAC3B,YAAY,EAAE,sBAAsB,EACpC,MAAM,EAAE,YAAY,EACpB,YAAY,EAAE,aAAa,EAC3B,kBAAkB,EAAE,kBAAkB,GAAG,SAAS,EAClD,OAAO,EAAE,uBAAuB,GAC9B,cAAc,CAYhB;AAED;;GAEG;AACH,wBAAgB,eAAe,CAC9B,WAAW,EAAE,iBAAiB,EAC9B,KAAK,EAAE,qBAAqB,EAC5B,OAAO,EAAE,cAAc,EACvB,YAAY,EAAE,sBAAsB,GAClC,YAAY,CA8Bd;AAED;;GAEG;AACH,wBAAgB,cAAc,CAC7B,YAAY,EAAE,kBAAkB,EAChC,YAAY,EAAE,sBAAsB,EACpC,UAAU,EAAE,wBAAwB,EACpC,kBAAkB,CAAC,EAAE,kBAAkB,GACrC,qBAAqB,CA4CvB"}
@@ -4,11 +4,11 @@
4
4
  */
5
5
  import { assert, unreachableCase, fail } from "@fluidframework/core-utils/internal";
6
6
  import { LeafNodeStoredSchema, MapNodeStoredSchema, ObjectNodeStoredSchema, ValueSchema, Multiplicity, identifierFieldKindIdentifier, } from "../../../core/index.js";
7
+ import { brand, oneFromIterable } from "../../../util/index.js";
7
8
  import { EncoderContext, anyNodeEncoder, asFieldEncoder, compressedEncode, incrementalFieldEncoder, } from "./compressedEncode.js";
8
9
  import { FieldBatchFormatVersion, SpecialField, } from "./format.js";
9
- import { NodeShapeBasedEncoder } from "./nodeEncoder.js";
10
10
  import { defaultIncrementalEncodingPolicy } from "./incrementalEncodingPolicy.js";
11
- import { brand, oneFromIterable } from "../../../util/index.js";
11
+ import { NodeShapeBasedEncoder } from "./nodeEncoder.js";
12
12
  /**
13
13
  * Encode data from `fieldBatch` in into an `EncodedChunk` using {@link FieldBatchFormatVersion.v1}.
14
14
  * @remarks See {@link schemaCompressedEncode} for more details.