@fluidframework/container-runtime 2.0.0-dev-rc.1.0.0.232845 → 2.0.0-dev-rc.2.0.0.246488

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 (700) hide show
  1. package/.eslintrc.cjs +5 -5
  2. package/{.mocharc.js → .mocharc.cjs} +1 -1
  3. package/CHANGELOG.md +54 -0
  4. package/README.md +45 -0
  5. package/{api-extractor-esm.json → api-extractor-cjs.json} +5 -1
  6. package/api-extractor-lint.json +1 -1
  7. package/api-extractor.json +1 -1
  8. package/api-report/container-runtime.api.md +426 -33
  9. package/dist/batchTracker.d.ts +1 -2
  10. package/dist/batchTracker.d.ts.map +1 -1
  11. package/dist/batchTracker.js.map +1 -1
  12. package/dist/blobManager.d.ts +0 -5
  13. package/dist/blobManager.d.ts.map +1 -1
  14. package/dist/blobManager.js +0 -12
  15. package/dist/blobManager.js.map +1 -1
  16. package/dist/channelCollection.d.ts +226 -0
  17. package/dist/channelCollection.d.ts.map +1 -0
  18. package/dist/{dataStores.js → channelCollection.js} +455 -150
  19. package/dist/channelCollection.js.map +1 -0
  20. package/dist/connectionTelemetry.d.ts +11 -1
  21. package/dist/connectionTelemetry.d.ts.map +1 -1
  22. package/dist/connectionTelemetry.js +42 -4
  23. package/dist/connectionTelemetry.js.map +1 -1
  24. package/dist/container-runtime-alpha.d.ts +128 -48
  25. package/dist/container-runtime-beta.d.ts +67 -9
  26. package/dist/container-runtime-public.d.ts +67 -9
  27. package/dist/container-runtime-untrimmed.d.ts +692 -49
  28. package/dist/containerHandleContext.d.ts +1 -1
  29. package/dist/containerHandleContext.d.ts.map +1 -1
  30. package/dist/containerHandleContext.js.map +1 -1
  31. package/dist/containerRuntime.d.ts +81 -64
  32. package/dist/containerRuntime.d.ts.map +1 -1
  33. package/dist/containerRuntime.js +522 -379
  34. package/dist/containerRuntime.js.map +1 -1
  35. package/dist/dataStore.d.ts +2 -3
  36. package/dist/dataStore.d.ts.map +1 -1
  37. package/dist/dataStore.js +12 -11
  38. package/dist/dataStore.js.map +1 -1
  39. package/dist/dataStoreContext.d.ts +118 -41
  40. package/dist/dataStoreContext.d.ts.map +1 -1
  41. package/dist/dataStoreContext.js +248 -159
  42. package/dist/dataStoreContext.js.map +1 -1
  43. package/dist/dataStoreContexts.d.ts +2 -1
  44. package/dist/dataStoreContexts.d.ts.map +1 -1
  45. package/dist/dataStoreContexts.js +1 -0
  46. package/dist/dataStoreContexts.js.map +1 -1
  47. package/dist/dataStoreRegistry.d.ts +4 -0
  48. package/dist/dataStoreRegistry.d.ts.map +1 -1
  49. package/dist/dataStoreRegistry.js +2 -2
  50. package/dist/dataStoreRegistry.js.map +1 -1
  51. package/dist/deltaManagerSummarizerProxy.d.ts +29 -4
  52. package/dist/deltaManagerSummarizerProxy.d.ts.map +1 -1
  53. package/dist/deltaManagerSummarizerProxy.js +91 -5
  54. package/dist/deltaManagerSummarizerProxy.js.map +1 -1
  55. package/dist/gc/garbageCollection.d.ts +12 -6
  56. package/dist/gc/garbageCollection.d.ts.map +1 -1
  57. package/dist/gc/garbageCollection.js +116 -78
  58. package/dist/gc/garbageCollection.js.map +1 -1
  59. package/dist/gc/gcConfigs.d.ts +2 -2
  60. package/dist/gc/gcConfigs.d.ts.map +1 -1
  61. package/dist/gc/gcConfigs.js +30 -23
  62. package/dist/gc/gcConfigs.js.map +1 -1
  63. package/dist/gc/gcDefinitions.d.ts +22 -13
  64. package/dist/gc/gcDefinitions.d.ts.map +1 -1
  65. package/dist/gc/gcDefinitions.js +7 -4
  66. package/dist/gc/gcDefinitions.js.map +1 -1
  67. package/dist/gc/gcHelpers.d.ts +2 -2
  68. package/dist/gc/gcHelpers.d.ts.map +1 -1
  69. package/dist/gc/gcHelpers.js.map +1 -1
  70. package/dist/gc/gcReferenceGraphAlgorithm.d.ts +1 -1
  71. package/dist/gc/gcReferenceGraphAlgorithm.d.ts.map +1 -1
  72. package/dist/gc/gcReferenceGraphAlgorithm.js.map +1 -1
  73. package/dist/gc/gcSummaryStateTracker.d.ts +12 -5
  74. package/dist/gc/gcSummaryStateTracker.d.ts.map +1 -1
  75. package/dist/gc/gcSummaryStateTracker.js +18 -6
  76. package/dist/gc/gcSummaryStateTracker.js.map +1 -1
  77. package/dist/gc/gcTelemetry.d.ts +6 -7
  78. package/dist/gc/gcTelemetry.d.ts.map +1 -1
  79. package/dist/gc/gcTelemetry.js +20 -18
  80. package/dist/gc/gcTelemetry.js.map +1 -1
  81. package/dist/gc/gcUnreferencedStateTracker.d.ts +1 -1
  82. package/dist/gc/gcUnreferencedStateTracker.d.ts.map +1 -1
  83. package/dist/gc/gcUnreferencedStateTracker.js +10 -10
  84. package/dist/gc/gcUnreferencedStateTracker.js.map +1 -1
  85. package/dist/gc/index.d.ts +8 -8
  86. package/dist/gc/index.d.ts.map +1 -1
  87. package/dist/gc/index.js +40 -39
  88. package/dist/gc/index.js.map +1 -1
  89. package/dist/index.d.ts +11 -21
  90. package/dist/index.d.ts.map +1 -1
  91. package/dist/index.js +36 -42
  92. package/dist/index.js.map +1 -1
  93. package/dist/messageTypes.d.ts +3 -3
  94. package/dist/messageTypes.d.ts.map +1 -1
  95. package/dist/messageTypes.js.map +1 -1
  96. package/dist/opLifecycle/batchManager.d.ts +2 -2
  97. package/dist/opLifecycle/batchManager.d.ts.map +1 -1
  98. package/dist/opLifecycle/batchManager.js.map +1 -1
  99. package/dist/opLifecycle/definitions.d.ts +2 -2
  100. package/dist/opLifecycle/definitions.d.ts.map +1 -1
  101. package/dist/opLifecycle/definitions.js.map +1 -1
  102. package/dist/opLifecycle/index.d.ts +8 -8
  103. package/dist/opLifecycle/index.d.ts.map +1 -1
  104. package/dist/opLifecycle/index.js +18 -18
  105. package/dist/opLifecycle/index.js.map +1 -1
  106. package/dist/opLifecycle/opCompressor.d.ts +1 -1
  107. package/dist/opLifecycle/opCompressor.d.ts.map +1 -1
  108. package/dist/opLifecycle/opCompressor.js +4 -4
  109. package/dist/opLifecycle/opCompressor.js.map +1 -1
  110. package/dist/opLifecycle/opDecompressor.d.ts +1 -1
  111. package/dist/opLifecycle/opDecompressor.d.ts.map +1 -1
  112. package/dist/opLifecycle/opDecompressor.js +3 -3
  113. package/dist/opLifecycle/opDecompressor.js.map +1 -1
  114. package/dist/opLifecycle/opGroupingManager.d.ts +1 -1
  115. package/dist/opLifecycle/opGroupingManager.d.ts.map +1 -1
  116. package/dist/opLifecycle/opGroupingManager.js +1 -10
  117. package/dist/opLifecycle/opGroupingManager.js.map +1 -1
  118. package/dist/opLifecycle/opSplitter.d.ts +1 -1
  119. package/dist/opLifecycle/opSplitter.d.ts.map +1 -1
  120. package/dist/opLifecycle/opSplitter.js +5 -5
  121. package/dist/opLifecycle/opSplitter.js.map +1 -1
  122. package/dist/opLifecycle/outbox.d.ts +7 -7
  123. package/dist/opLifecycle/outbox.d.ts.map +1 -1
  124. package/dist/opLifecycle/outbox.js +32 -18
  125. package/dist/opLifecycle/outbox.js.map +1 -1
  126. package/dist/opLifecycle/remoteMessageProcessor.d.ts +4 -4
  127. package/dist/opLifecycle/remoteMessageProcessor.d.ts.map +1 -1
  128. package/dist/opLifecycle/remoteMessageProcessor.js +7 -4
  129. package/dist/opLifecycle/remoteMessageProcessor.js.map +1 -1
  130. package/dist/package.json +3 -0
  131. package/dist/packageVersion.d.ts +1 -1
  132. package/dist/packageVersion.js +1 -1
  133. package/dist/packageVersion.js.map +1 -1
  134. package/dist/pendingStateManager.d.ts +2 -1
  135. package/dist/pendingStateManager.d.ts.map +1 -1
  136. package/dist/pendingStateManager.js +18 -10
  137. package/dist/pendingStateManager.js.map +1 -1
  138. package/dist/scheduleManager.d.ts +1 -2
  139. package/dist/scheduleManager.d.ts.map +1 -1
  140. package/dist/scheduleManager.js +9 -5
  141. package/dist/scheduleManager.js.map +1 -1
  142. package/dist/summary/index.d.ts +12 -12
  143. package/dist/summary/index.d.ts.map +1 -1
  144. package/dist/summary/index.js +43 -43
  145. package/dist/summary/index.js.map +1 -1
  146. package/dist/summary/orderedClientElection.d.ts.map +1 -1
  147. package/dist/summary/orderedClientElection.js +12 -8
  148. package/dist/summary/orderedClientElection.js.map +1 -1
  149. package/dist/summary/runWhileConnectedCoordinator.d.ts +1 -1
  150. package/dist/summary/runWhileConnectedCoordinator.d.ts.map +1 -1
  151. package/dist/summary/runWhileConnectedCoordinator.js.map +1 -1
  152. package/dist/summary/runningSummarizer.d.ts +5 -4
  153. package/dist/summary/runningSummarizer.d.ts.map +1 -1
  154. package/dist/summary/runningSummarizer.js +47 -32
  155. package/dist/summary/runningSummarizer.js.map +1 -1
  156. package/dist/summary/summarizer.d.ts +4 -4
  157. package/dist/summary/summarizer.d.ts.map +1 -1
  158. package/dist/summary/summarizer.js +6 -6
  159. package/dist/summary/summarizer.js.map +1 -1
  160. package/dist/summary/summarizerClientElection.d.ts +2 -2
  161. package/dist/summary/summarizerClientElection.d.ts.map +1 -1
  162. package/dist/summary/summarizerClientElection.js.map +1 -1
  163. package/dist/summary/summarizerHeuristics.d.ts +3 -3
  164. package/dist/summary/summarizerHeuristics.d.ts.map +1 -1
  165. package/dist/summary/summarizerHeuristics.js.map +1 -1
  166. package/dist/summary/summarizerNode/index.d.ts +3 -3
  167. package/dist/summary/summarizerNode/index.d.ts.map +1 -1
  168. package/dist/summary/summarizerNode/index.js +4 -4
  169. package/dist/summary/summarizerNode/index.js.map +1 -1
  170. package/dist/summary/summarizerNode/summarizerNode.d.ts +16 -5
  171. package/dist/summary/summarizerNode/summarizerNode.d.ts.map +1 -1
  172. package/dist/summary/summarizerNode/summarizerNode.js +40 -10
  173. package/dist/summary/summarizerNode/summarizerNode.js.map +1 -1
  174. package/dist/summary/summarizerNode/summarizerNodeUtils.d.ts +9 -1
  175. package/dist/summary/summarizerNode/summarizerNodeUtils.d.ts.map +1 -1
  176. package/dist/summary/summarizerNode/summarizerNodeUtils.js.map +1 -1
  177. package/dist/summary/summarizerNode/summarizerNodeWithGc.d.ts +3 -4
  178. package/dist/summary/summarizerNode/summarizerNodeWithGc.d.ts.map +1 -1
  179. package/dist/summary/summarizerNode/summarizerNodeWithGc.js +12 -12
  180. package/dist/summary/summarizerNode/summarizerNodeWithGc.js.map +1 -1
  181. package/dist/summary/summarizerTypes.d.ts +9 -20
  182. package/dist/summary/summarizerTypes.d.ts.map +1 -1
  183. package/dist/summary/summarizerTypes.js.map +1 -1
  184. package/dist/summary/summaryFormat.d.ts +15 -2
  185. package/dist/summary/summaryFormat.d.ts.map +1 -1
  186. package/dist/summary/summaryFormat.js.map +1 -1
  187. package/dist/summary/summaryGenerator.d.ts +6 -5
  188. package/dist/summary/summaryGenerator.d.ts.map +1 -1
  189. package/dist/summary/summaryGenerator.js +10 -1
  190. package/dist/summary/summaryGenerator.js.map +1 -1
  191. package/dist/summary/summaryManager.d.ts +5 -6
  192. package/dist/summary/summaryManager.d.ts.map +1 -1
  193. package/dist/summary/summaryManager.js +4 -5
  194. package/dist/summary/summaryManager.js.map +1 -1
  195. package/dist/tsdoc-metadata.json +1 -1
  196. package/lib/{batchTracker.d.mts → batchTracker.d.ts} +2 -3
  197. package/lib/batchTracker.d.ts.map +1 -0
  198. package/lib/{batchTracker.mjs → batchTracker.js} +1 -1
  199. package/lib/batchTracker.js.map +1 -0
  200. package/lib/{blobManager.d.mts → blobManager.d.ts} +1 -6
  201. package/lib/blobManager.d.ts.map +1 -0
  202. package/lib/{blobManager.mjs → blobManager.js} +1 -13
  203. package/lib/blobManager.js.map +1 -0
  204. package/lib/channelCollection.d.ts +226 -0
  205. package/lib/channelCollection.d.ts.map +1 -0
  206. package/lib/{dataStores.mjs → channelCollection.js} +442 -140
  207. package/lib/channelCollection.js.map +1 -0
  208. package/lib/{connectionTelemetry.d.mts → connectionTelemetry.d.ts} +12 -2
  209. package/lib/connectionTelemetry.d.ts.map +1 -0
  210. package/lib/{connectionTelemetry.mjs → connectionTelemetry.js} +43 -5
  211. package/lib/connectionTelemetry.js.map +1 -0
  212. package/lib/{container-runtime-alpha.d.mts → container-runtime-alpha.d.ts} +128 -48
  213. package/lib/{container-runtime-beta.d.mts → container-runtime-beta.d.ts} +67 -9
  214. package/lib/{container-runtime-public.d.mts → container-runtime-public.d.ts} +67 -9
  215. package/lib/{container-runtime-untrimmed.d.mts → container-runtime-untrimmed.d.ts} +692 -49
  216. package/lib/{containerHandleContext.d.mts → containerHandleContext.d.ts} +2 -2
  217. package/lib/containerHandleContext.d.ts.map +1 -0
  218. package/lib/{containerHandleContext.mjs → containerHandleContext.js} +1 -1
  219. package/lib/containerHandleContext.js.map +1 -0
  220. package/lib/{containerRuntime.d.mts → containerRuntime.d.ts} +86 -65
  221. package/lib/containerRuntime.d.ts.map +1 -0
  222. package/lib/{containerRuntime.mjs → containerRuntime.js} +444 -303
  223. package/lib/containerRuntime.js.map +1 -0
  224. package/lib/{dataStore.d.mts → dataStore.d.ts} +3 -4
  225. package/lib/dataStore.d.ts.map +1 -0
  226. package/lib/{dataStore.mjs → dataStore.js} +13 -12
  227. package/lib/dataStore.js.map +1 -0
  228. package/lib/{dataStoreContext.d.mts → dataStoreContext.d.ts} +119 -42
  229. package/lib/dataStoreContext.d.ts.map +1 -0
  230. package/lib/{dataStoreContext.mjs → dataStoreContext.js} +240 -151
  231. package/lib/dataStoreContext.js.map +1 -0
  232. package/lib/{dataStoreContexts.d.mts → dataStoreContexts.d.ts} +3 -2
  233. package/lib/dataStoreContexts.d.ts.map +1 -0
  234. package/lib/{dataStoreContexts.mjs → dataStoreContexts.js} +2 -1
  235. package/lib/dataStoreContexts.js.map +1 -0
  236. package/lib/{dataStoreRegistry.d.mts → dataStoreRegistry.d.ts} +5 -1
  237. package/lib/dataStoreRegistry.d.ts.map +1 -0
  238. package/lib/{dataStoreRegistry.mjs → dataStoreRegistry.js} +5 -1
  239. package/lib/dataStoreRegistry.js.map +1 -0
  240. package/{dist/deltaManagerProxyBase.d.ts → lib/deltaManagerSummarizerProxy.d.ts} +16 -7
  241. package/lib/deltaManagerSummarizerProxy.d.ts.map +1 -0
  242. package/lib/deltaManagerSummarizerProxy.js +124 -0
  243. package/lib/deltaManagerSummarizerProxy.js.map +1 -0
  244. package/lib/{deltaScheduler.d.mts → deltaScheduler.d.ts} +1 -1
  245. package/lib/deltaScheduler.d.ts.map +1 -0
  246. package/lib/{deltaScheduler.mjs → deltaScheduler.js} +1 -1
  247. package/lib/deltaScheduler.js.map +1 -0
  248. package/lib/{error.d.mts → error.d.ts} +1 -1
  249. package/lib/error.d.ts.map +1 -0
  250. package/lib/{error.mjs → error.js} +1 -1
  251. package/lib/error.js.map +1 -0
  252. package/lib/gc/{garbageCollection.d.mts → garbageCollection.d.ts} +13 -7
  253. package/lib/gc/garbageCollection.d.ts.map +1 -0
  254. package/lib/gc/{garbageCollection.mjs → garbageCollection.js} +79 -41
  255. package/lib/gc/garbageCollection.js.map +1 -0
  256. package/lib/gc/{gcConfigs.d.mts → gcConfigs.d.ts} +3 -3
  257. package/lib/gc/gcConfigs.d.ts.map +1 -0
  258. package/lib/gc/{gcConfigs.mjs → gcConfigs.js} +14 -7
  259. package/lib/gc/gcConfigs.js.map +1 -0
  260. package/lib/gc/{gcDefinitions.d.mts → gcDefinitions.d.ts} +23 -14
  261. package/lib/gc/gcDefinitions.d.ts.map +1 -0
  262. package/lib/gc/{gcDefinitions.mjs → gcDefinitions.js} +7 -4
  263. package/lib/gc/gcDefinitions.js.map +1 -0
  264. package/lib/gc/{gcHelpers.d.mts → gcHelpers.d.ts} +3 -3
  265. package/lib/gc/{gcHelpers.d.mts.map → gcHelpers.d.ts.map} +1 -1
  266. package/lib/gc/{gcHelpers.mjs → gcHelpers.js} +1 -1
  267. package/lib/gc/gcHelpers.js.map +1 -0
  268. package/lib/gc/{gcReferenceGraphAlgorithm.d.mts → gcReferenceGraphAlgorithm.d.ts} +2 -2
  269. package/lib/gc/gcReferenceGraphAlgorithm.d.ts.map +1 -0
  270. package/lib/gc/{gcReferenceGraphAlgorithm.mjs → gcReferenceGraphAlgorithm.js} +1 -1
  271. package/lib/gc/gcReferenceGraphAlgorithm.js.map +1 -0
  272. package/lib/gc/{gcSummaryDefinitions.d.mts → gcSummaryDefinitions.d.ts} +1 -1
  273. package/lib/gc/gcSummaryDefinitions.d.ts.map +1 -0
  274. package/lib/gc/{gcSummaryDefinitions.mjs → gcSummaryDefinitions.js} +1 -1
  275. package/lib/gc/gcSummaryDefinitions.js.map +1 -0
  276. package/lib/gc/{gcSummaryStateTracker.d.mts → gcSummaryStateTracker.d.ts} +13 -6
  277. package/lib/gc/gcSummaryStateTracker.d.ts.map +1 -0
  278. package/lib/gc/{gcSummaryStateTracker.mjs → gcSummaryStateTracker.js} +17 -5
  279. package/lib/gc/gcSummaryStateTracker.js.map +1 -0
  280. package/lib/gc/{gcTelemetry.d.mts → gcTelemetry.d.ts} +7 -8
  281. package/lib/gc/gcTelemetry.d.ts.map +1 -0
  282. package/lib/gc/{gcTelemetry.mjs → gcTelemetry.js} +5 -3
  283. package/lib/gc/gcTelemetry.js.map +1 -0
  284. package/lib/gc/{gcUnreferencedStateTracker.d.mts → gcUnreferencedStateTracker.d.ts} +2 -2
  285. package/lib/gc/gcUnreferencedStateTracker.d.ts.map +1 -0
  286. package/lib/gc/{gcUnreferencedStateTracker.mjs → gcUnreferencedStateTracker.js} +2 -2
  287. package/lib/gc/gcUnreferencedStateTracker.js.map +1 -0
  288. package/lib/gc/index.d.ts +13 -0
  289. package/lib/gc/index.d.ts.map +1 -0
  290. package/lib/gc/{index.mjs → index.js} +8 -8
  291. package/lib/gc/index.js.map +1 -0
  292. package/lib/{index.d.mts → index.d.ts} +12 -22
  293. package/lib/index.d.ts.map +1 -0
  294. package/lib/index.js +15 -0
  295. package/lib/index.js.map +1 -0
  296. package/lib/{messageTypes.d.mts → messageTypes.d.ts} +4 -4
  297. package/lib/messageTypes.d.ts.map +1 -0
  298. package/lib/{messageTypes.mjs → messageTypes.js} +1 -1
  299. package/lib/messageTypes.js.map +1 -0
  300. package/lib/{metadata.d.mts → metadata.d.ts} +1 -1
  301. package/lib/metadata.d.ts.map +1 -0
  302. package/lib/{metadata.mjs → metadata.js} +1 -1
  303. package/lib/metadata.js.map +1 -0
  304. package/lib/opLifecycle/{batchManager.d.mts → batchManager.d.ts} +3 -3
  305. package/lib/opLifecycle/batchManager.d.ts.map +1 -0
  306. package/lib/opLifecycle/{batchManager.mjs → batchManager.js} +1 -1
  307. package/lib/opLifecycle/batchManager.js.map +1 -0
  308. package/lib/opLifecycle/{definitions.d.mts → definitions.d.ts} +3 -3
  309. package/lib/opLifecycle/definitions.d.ts.map +1 -0
  310. package/lib/opLifecycle/{definitions.mjs → definitions.js} +1 -1
  311. package/lib/opLifecycle/definitions.js.map +1 -0
  312. package/lib/opLifecycle/index.d.ts +13 -0
  313. package/lib/opLifecycle/index.d.ts.map +1 -0
  314. package/lib/opLifecycle/index.js +12 -0
  315. package/lib/opLifecycle/index.js.map +1 -0
  316. package/lib/opLifecycle/{opCompressor.d.mts → opCompressor.d.ts} +2 -2
  317. package/lib/opLifecycle/opCompressor.d.ts.map +1 -0
  318. package/lib/opLifecycle/{opCompressor.mjs → opCompressor.js} +3 -3
  319. package/lib/opLifecycle/opCompressor.js.map +1 -0
  320. package/lib/opLifecycle/{opDecompressor.d.mts → opDecompressor.d.ts} +2 -2
  321. package/lib/opLifecycle/opDecompressor.d.ts.map +1 -0
  322. package/lib/opLifecycle/{opDecompressor.mjs → opDecompressor.js} +2 -2
  323. package/lib/opLifecycle/opDecompressor.js.map +1 -0
  324. package/lib/opLifecycle/{opGroupingManager.d.mts → opGroupingManager.d.ts} +2 -2
  325. package/lib/opLifecycle/opGroupingManager.d.ts.map +1 -0
  326. package/lib/opLifecycle/{opGroupingManager.mjs → opGroupingManager.js} +2 -11
  327. package/lib/opLifecycle/opGroupingManager.js.map +1 -0
  328. package/lib/opLifecycle/{opSplitter.d.mts → opSplitter.d.ts} +2 -2
  329. package/lib/opLifecycle/opSplitter.d.ts.map +1 -0
  330. package/lib/opLifecycle/{opSplitter.mjs → opSplitter.js} +3 -3
  331. package/lib/opLifecycle/opSplitter.js.map +1 -0
  332. package/lib/opLifecycle/{outbox.d.mts → outbox.d.ts} +8 -8
  333. package/lib/opLifecycle/outbox.d.ts.map +1 -0
  334. package/lib/opLifecycle/{outbox.mjs → outbox.js} +24 -10
  335. package/lib/opLifecycle/outbox.js.map +1 -0
  336. package/lib/opLifecycle/{remoteMessageProcessor.d.mts → remoteMessageProcessor.d.ts} +5 -5
  337. package/lib/opLifecycle/remoteMessageProcessor.d.ts.map +1 -0
  338. package/lib/opLifecycle/{remoteMessageProcessor.mjs → remoteMessageProcessor.js} +7 -4
  339. package/lib/opLifecycle/remoteMessageProcessor.js.map +1 -0
  340. package/lib/{opProperties.d.mts → opProperties.d.ts} +1 -1
  341. package/lib/opProperties.d.ts.map +1 -0
  342. package/lib/{opProperties.mjs → opProperties.js} +1 -1
  343. package/lib/opProperties.js.map +1 -0
  344. package/lib/{packageVersion.d.mts → packageVersion.d.ts} +2 -2
  345. package/lib/packageVersion.d.ts.map +1 -0
  346. package/lib/{packageVersion.mjs → packageVersion.js} +2 -2
  347. package/lib/packageVersion.js.map +1 -0
  348. package/lib/{pendingStateManager.d.mts → pendingStateManager.d.ts} +3 -2
  349. package/lib/pendingStateManager.d.ts.map +1 -0
  350. package/lib/{pendingStateManager.mjs → pendingStateManager.js} +18 -10
  351. package/lib/pendingStateManager.js.map +1 -0
  352. package/lib/{scheduleManager.d.mts → scheduleManager.d.ts} +6 -3
  353. package/lib/scheduleManager.d.ts.map +1 -0
  354. package/lib/{scheduleManager.mjs → scheduleManager.js} +7 -3
  355. package/lib/scheduleManager.js.map +1 -0
  356. package/lib/{storageServiceWithAttachBlobs.d.mts → storageServiceWithAttachBlobs.d.ts} +1 -1
  357. package/lib/storageServiceWithAttachBlobs.d.ts.map +1 -0
  358. package/lib/{storageServiceWithAttachBlobs.mjs → storageServiceWithAttachBlobs.js} +1 -1
  359. package/lib/storageServiceWithAttachBlobs.js.map +1 -0
  360. package/lib/summary/{index.d.mts → index.d.ts} +13 -13
  361. package/lib/summary/index.d.ts.map +1 -0
  362. package/lib/summary/{index.mjs → index.js} +12 -12
  363. package/lib/summary/index.js.map +1 -0
  364. package/lib/summary/{orderedClientElection.d.mts → orderedClientElection.d.ts} +5 -1
  365. package/lib/summary/orderedClientElection.d.ts.map +1 -0
  366. package/lib/summary/{orderedClientElection.mjs → orderedClientElection.js} +6 -2
  367. package/lib/summary/orderedClientElection.js.map +1 -0
  368. package/lib/summary/{runWhileConnectedCoordinator.d.mts → runWhileConnectedCoordinator.d.ts} +2 -2
  369. package/lib/summary/runWhileConnectedCoordinator.d.ts.map +1 -0
  370. package/lib/summary/{runWhileConnectedCoordinator.mjs → runWhileConnectedCoordinator.js} +1 -1
  371. package/lib/summary/runWhileConnectedCoordinator.js.map +1 -0
  372. package/lib/summary/{runningSummarizer.d.mts → runningSummarizer.d.ts} +6 -5
  373. package/lib/summary/runningSummarizer.d.ts.map +1 -0
  374. package/lib/summary/{runningSummarizer.mjs → runningSummarizer.js} +41 -26
  375. package/lib/summary/runningSummarizer.js.map +1 -0
  376. package/lib/summary/{summarizer.d.mts → summarizer.d.ts} +5 -5
  377. package/lib/summary/summarizer.d.ts.map +1 -0
  378. package/lib/summary/{summarizer.mjs → summarizer.js} +4 -4
  379. package/lib/summary/summarizer.js.map +1 -0
  380. package/lib/summary/{summarizerClientElection.d.mts → summarizerClientElection.d.ts} +3 -3
  381. package/lib/summary/summarizerClientElection.d.ts.map +1 -0
  382. package/lib/summary/{summarizerClientElection.mjs → summarizerClientElection.js} +1 -1
  383. package/lib/summary/summarizerClientElection.js.map +1 -0
  384. package/lib/summary/{summarizerHeuristics.d.mts → summarizerHeuristics.d.ts} +4 -4
  385. package/lib/summary/summarizerHeuristics.d.ts.map +1 -0
  386. package/lib/summary/{summarizerHeuristics.mjs → summarizerHeuristics.js} +1 -1
  387. package/lib/summary/summarizerHeuristics.js.map +1 -0
  388. package/lib/summary/summarizerNode/{index.d.mts → index.d.ts} +4 -4
  389. package/lib/summary/summarizerNode/index.d.ts.map +1 -0
  390. package/lib/summary/summarizerNode/index.js +7 -0
  391. package/lib/summary/summarizerNode/index.js.map +1 -0
  392. package/lib/summary/summarizerNode/{summarizerNode.d.mts → summarizerNode.d.ts} +17 -6
  393. package/lib/summary/summarizerNode/summarizerNode.d.ts.map +1 -0
  394. package/lib/summary/summarizerNode/{summarizerNode.mjs → summarizerNode.js} +34 -4
  395. package/lib/summary/summarizerNode/summarizerNode.js.map +1 -0
  396. package/lib/summary/summarizerNode/{summarizerNodeUtils.d.mts → summarizerNodeUtils.d.ts} +10 -2
  397. package/lib/summary/summarizerNode/summarizerNodeUtils.d.ts.map +1 -0
  398. package/lib/summary/summarizerNode/{summarizerNodeUtils.mjs → summarizerNodeUtils.js} +1 -1
  399. package/lib/summary/summarizerNode/summarizerNodeUtils.js.map +1 -0
  400. package/lib/summary/summarizerNode/{summarizerNodeWithGc.d.mts → summarizerNodeWithGc.d.ts} +4 -5
  401. package/lib/summary/summarizerNode/summarizerNodeWithGc.d.ts.map +1 -0
  402. package/lib/summary/summarizerNode/{summarizerNodeWithGc.mjs → summarizerNodeWithGc.js} +7 -7
  403. package/lib/summary/summarizerNode/summarizerNodeWithGc.js.map +1 -0
  404. package/lib/summary/{summarizerTypes.d.mts → summarizerTypes.d.ts} +10 -21
  405. package/lib/summary/summarizerTypes.d.ts.map +1 -0
  406. package/lib/summary/{summarizerTypes.mjs → summarizerTypes.js} +1 -1
  407. package/lib/summary/summarizerTypes.js.map +1 -0
  408. package/lib/summary/{summaryCollection.d.mts → summaryCollection.d.ts} +1 -1
  409. package/lib/summary/summaryCollection.d.ts.map +1 -0
  410. package/lib/summary/{summaryCollection.mjs → summaryCollection.js} +1 -1
  411. package/lib/summary/summaryCollection.js.map +1 -0
  412. package/lib/summary/{summaryFormat.d.mts → summaryFormat.d.ts} +16 -3
  413. package/lib/summary/summaryFormat.d.ts.map +1 -0
  414. package/lib/summary/{summaryFormat.mjs → summaryFormat.js} +1 -1
  415. package/lib/summary/summaryFormat.js.map +1 -0
  416. package/lib/summary/{summaryGenerator.d.mts → summaryGenerator.d.ts} +7 -6
  417. package/lib/summary/summaryGenerator.d.ts.map +1 -0
  418. package/lib/summary/{summaryGenerator.mjs → summaryGenerator.js} +11 -2
  419. package/lib/summary/summaryGenerator.js.map +1 -0
  420. package/lib/summary/{summaryManager.d.mts → summaryManager.d.ts} +6 -7
  421. package/lib/summary/summaryManager.d.ts.map +1 -0
  422. package/lib/summary/{summaryManager.mjs → summaryManager.js} +4 -5
  423. package/lib/summary/summaryManager.js.map +1 -0
  424. package/lib/test/batchTracker.spec.js +88 -0
  425. package/lib/test/batchTracker.spec.js.map +1 -0
  426. package/lib/test/blobManager.spec.js +835 -0
  427. package/lib/test/blobManager.spec.js.map +1 -0
  428. package/lib/test/channelCollection.spec.js +138 -0
  429. package/lib/test/channelCollection.spec.js.map +1 -0
  430. package/lib/test/containerRuntime.spec.js +1748 -0
  431. package/lib/test/containerRuntime.spec.js.map +1 -0
  432. package/lib/test/dataStoreContext.spec.js +771 -0
  433. package/lib/test/dataStoreContext.spec.js.map +1 -0
  434. package/lib/test/dataStoreCreation.spec.js +303 -0
  435. package/lib/test/dataStoreCreation.spec.js.map +1 -0
  436. package/lib/test/dataStoreRegistry.spec.js +26 -0
  437. package/lib/test/dataStoreRegistry.spec.js.map +1 -0
  438. package/lib/test/fuzz/fuzzUtils.js +66 -0
  439. package/lib/test/fuzz/fuzzUtils.js.map +1 -0
  440. package/lib/test/fuzz/summarizer.fuzz.spec.js +31 -0
  441. package/lib/test/fuzz/summarizer.fuzz.spec.js.map +1 -0
  442. package/lib/test/fuzz/summarizerFuzzMocks.js +162 -0
  443. package/lib/test/fuzz/summarizerFuzzMocks.js.map +1 -0
  444. package/lib/test/fuzz/summarizerFuzzSuite.js +106 -0
  445. package/lib/test/fuzz/summarizerFuzzSuite.js.map +1 -0
  446. package/lib/test/gc/garbageCollection.spec.js +1464 -0
  447. package/lib/test/gc/garbageCollection.spec.js.map +1 -0
  448. package/lib/test/gc/gcConfigs.spec.js +689 -0
  449. package/lib/test/gc/gcConfigs.spec.js.map +1 -0
  450. package/lib/test/gc/gcHelpers.spec.js +110 -0
  451. package/lib/test/gc/gcHelpers.spec.js.map +1 -0
  452. package/lib/test/gc/gcReferenceGraphAlgorithm.spec.js +68 -0
  453. package/lib/test/gc/gcReferenceGraphAlgorithm.spec.js.map +1 -0
  454. package/lib/test/gc/gcStats.spec.js +390 -0
  455. package/lib/test/gc/gcStats.spec.js.map +1 -0
  456. package/lib/test/gc/gcSummaryStateTracker.spec.js +228 -0
  457. package/lib/test/gc/gcSummaryStateTracker.spec.js.map +1 -0
  458. package/lib/test/gc/gcTelemetry.spec.js +530 -0
  459. package/lib/test/gc/gcTelemetry.spec.js.map +1 -0
  460. package/lib/test/gc/gcUnitTestHelpers.js +29 -0
  461. package/lib/test/gc/gcUnitTestHelpers.js.map +1 -0
  462. package/lib/test/gc/gcUnreferencedStateTracker.spec.js +192 -0
  463. package/lib/test/gc/gcUnreferencedStateTracker.spec.js.map +1 -0
  464. package/lib/test/getPendingBlobs.spec.js +193 -0
  465. package/lib/test/getPendingBlobs.spec.js.map +1 -0
  466. package/lib/test/hardwareStats.spec.js +93 -0
  467. package/lib/test/hardwareStats.spec.js.map +1 -0
  468. package/lib/test/index.js +6 -0
  469. package/lib/test/index.js.map +1 -0
  470. package/lib/test/opLifecycle/OpGroupingManager.spec.js +225 -0
  471. package/lib/test/opLifecycle/OpGroupingManager.spec.js.map +1 -0
  472. package/lib/test/opLifecycle/batchManager.spec.js +189 -0
  473. package/lib/test/opLifecycle/batchManager.spec.js.map +1 -0
  474. package/lib/test/opLifecycle/opCompressor.spec.js +74 -0
  475. package/lib/test/opLifecycle/opCompressor.spec.js.map +1 -0
  476. package/lib/test/opLifecycle/opDecompressor.spec.js +218 -0
  477. package/lib/test/opLifecycle/opDecompressor.spec.js.map +1 -0
  478. package/lib/test/opLifecycle/opSplitter.spec.js +272 -0
  479. package/lib/test/opLifecycle/opSplitter.spec.js.map +1 -0
  480. package/lib/test/opLifecycle/outbox.spec.js +675 -0
  481. package/lib/test/opLifecycle/outbox.spec.js.map +1 -0
  482. package/lib/test/opLifecycle/remoteMessageProcessor.spec.js +196 -0
  483. package/lib/test/opLifecycle/remoteMessageProcessor.spec.js.map +1 -0
  484. package/lib/test/pendingStateManager.spec.js +329 -0
  485. package/lib/test/pendingStateManager.spec.js.map +1 -0
  486. package/lib/test/scheduleManager.spec.js +270 -0
  487. package/lib/test/scheduleManager.spec.js.map +1 -0
  488. package/lib/test/summarizerNode.spec.js +326 -0
  489. package/lib/test/summarizerNode.spec.js.map +1 -0
  490. package/lib/test/summarizerNodeWithGc.spec.js +318 -0
  491. package/lib/test/summarizerNodeWithGc.spec.js.map +1 -0
  492. package/lib/test/summary/orderedClientElection.spec.js +535 -0
  493. package/lib/test/summary/orderedClientElection.spec.js.map +1 -0
  494. package/lib/test/summary/runningSummarizer.spec.js +1349 -0
  495. package/lib/test/summary/runningSummarizer.spec.js.map +1 -0
  496. package/lib/test/summary/summarizer.spec.js +29 -0
  497. package/lib/test/summary/summarizer.spec.js.map +1 -0
  498. package/lib/test/summary/summarizerClientElection.spec.js +436 -0
  499. package/lib/test/summary/summarizerClientElection.spec.js.map +1 -0
  500. package/lib/test/summary/summarizerHeuristics.spec.js +289 -0
  501. package/lib/test/summary/summarizerHeuristics.spec.js.map +1 -0
  502. package/lib/test/summary/summaryCollection.spec.js +200 -0
  503. package/lib/test/summary/summaryCollection.spec.js.map +1 -0
  504. package/lib/test/summary/summaryManager.spec.js +430 -0
  505. package/lib/test/summary/summaryManager.spec.js.map +1 -0
  506. package/lib/test/summary/testQuorumClients.js +34 -0
  507. package/lib/test/summary/testQuorumClients.js.map +1 -0
  508. package/lib/test/throttler.spec.js +175 -0
  509. package/lib/test/throttler.spec.js.map +1 -0
  510. package/lib/test/types/validateContainerRuntimePrevious.generated.js +180 -0
  511. package/lib/test/types/validateContainerRuntimePrevious.generated.js.map +1 -0
  512. package/lib/{throttler.d.mts → throttler.d.ts} +1 -1
  513. package/lib/throttler.d.ts.map +1 -0
  514. package/lib/{throttler.mjs → throttler.js} +1 -1
  515. package/lib/throttler.js.map +1 -0
  516. package/package.json +101 -88
  517. package/src/batchTracker.ts +1 -1
  518. package/src/blobManager.ts +1 -15
  519. package/src/{dataStores.ts → channelCollection.ts} +629 -178
  520. package/src/connectionTelemetry.ts +42 -3
  521. package/src/containerHandleContext.ts +1 -1
  522. package/src/containerRuntime.ts +626 -430
  523. package/src/dataStore.ts +16 -15
  524. package/src/dataStoreContext.ts +376 -216
  525. package/src/dataStoreContexts.ts +2 -1
  526. package/src/dataStoreRegistry.ts +1 -0
  527. package/src/deltaManagerSummarizerProxy.ts +132 -7
  528. package/src/gc/garbageCollection.ts +84 -44
  529. package/src/gc/gcConfigs.ts +17 -7
  530. package/src/gc/gcDefinitions.ts +23 -13
  531. package/src/gc/gcHelpers.ts +2 -2
  532. package/src/gc/gcReferenceGraphAlgorithm.ts +1 -1
  533. package/src/gc/gcSummaryStateTracker.ts +19 -7
  534. package/src/gc/gcTelemetry.ts +9 -7
  535. package/src/gc/gcUnreferencedStateTracker.ts +1 -1
  536. package/src/gc/index.ts +10 -9
  537. package/src/index.ts +28 -27
  538. package/src/messageTypes.ts +3 -3
  539. package/src/opLifecycle/README.md +2 -4
  540. package/src/opLifecycle/batchManager.ts +2 -2
  541. package/src/opLifecycle/definitions.ts +2 -2
  542. package/src/opLifecycle/index.ts +8 -8
  543. package/src/opLifecycle/opCompressor.ts +3 -3
  544. package/src/opLifecycle/opDecompressor.ts +3 -3
  545. package/src/opLifecycle/opGroupingManager.ts +3 -12
  546. package/src/opLifecycle/opSplitter.ts +3 -3
  547. package/src/opLifecycle/outbox.ts +43 -16
  548. package/src/opLifecycle/remoteMessageProcessor.ts +10 -6
  549. package/src/packageVersion.ts +1 -1
  550. package/src/pendingStateManager.ts +19 -13
  551. package/src/scheduleManager.ts +5 -4
  552. package/src/summary/index.ts +13 -12
  553. package/src/summary/orderedClientElection.ts +2 -1
  554. package/src/summary/runWhileConnectedCoordinator.ts +1 -1
  555. package/src/summary/runningSummarizer.ts +52 -32
  556. package/src/summary/summarizer.ts +7 -7
  557. package/src/summary/summarizerClientElection.ts +2 -2
  558. package/src/summary/summarizerHeuristics.ts +3 -3
  559. package/src/summary/summarizerNode/index.ts +6 -3
  560. package/src/summary/summarizerNode/summarizerNode.ts +50 -5
  561. package/src/summary/summarizerNode/summarizerNodeUtils.ts +14 -1
  562. package/src/summary/summarizerNode/summarizerNodeWithGc.ts +11 -11
  563. package/src/summary/summarizerTypes.ts +11 -23
  564. package/src/summary/summaryFormat.ts +16 -2
  565. package/src/summary/summaryGenerator.ts +16 -4
  566. package/src/summary/summaryManager.ts +6 -7
  567. package/tsconfig.cjs.json +7 -0
  568. package/tsconfig.json +2 -5
  569. package/dist/dataStores.d.ts +0 -151
  570. package/dist/dataStores.d.ts.map +0 -1
  571. package/dist/dataStores.js.map +0 -1
  572. package/dist/deltaManagerProxyBase.d.ts.map +0 -1
  573. package/dist/deltaManagerProxyBase.js +0 -77
  574. package/dist/deltaManagerProxyBase.js.map +0 -1
  575. package/lib/batchTracker.d.mts.map +0 -1
  576. package/lib/batchTracker.mjs.map +0 -1
  577. package/lib/blobManager.d.mts.map +0 -1
  578. package/lib/blobManager.mjs.map +0 -1
  579. package/lib/connectionTelemetry.d.mts.map +0 -1
  580. package/lib/connectionTelemetry.mjs.map +0 -1
  581. package/lib/containerHandleContext.d.mts.map +0 -1
  582. package/lib/containerHandleContext.mjs.map +0 -1
  583. package/lib/containerRuntime.d.mts.map +0 -1
  584. package/lib/containerRuntime.mjs.map +0 -1
  585. package/lib/dataStore.d.mts.map +0 -1
  586. package/lib/dataStore.mjs.map +0 -1
  587. package/lib/dataStoreContext.d.mts.map +0 -1
  588. package/lib/dataStoreContext.mjs.map +0 -1
  589. package/lib/dataStoreContexts.d.mts.map +0 -1
  590. package/lib/dataStoreContexts.mjs.map +0 -1
  591. package/lib/dataStoreRegistry.d.mts.map +0 -1
  592. package/lib/dataStoreRegistry.mjs.map +0 -1
  593. package/lib/dataStores.d.mts +0 -151
  594. package/lib/dataStores.d.mts.map +0 -1
  595. package/lib/dataStores.mjs.map +0 -1
  596. package/lib/deltaManagerProxyBase.d.mts +0 -35
  597. package/lib/deltaManagerProxyBase.d.mts.map +0 -1
  598. package/lib/deltaManagerProxyBase.mjs +0 -73
  599. package/lib/deltaManagerProxyBase.mjs.map +0 -1
  600. package/lib/deltaManagerSummarizerProxy.d.mts +0 -19
  601. package/lib/deltaManagerSummarizerProxy.d.mts.map +0 -1
  602. package/lib/deltaManagerSummarizerProxy.mjs +0 -38
  603. package/lib/deltaManagerSummarizerProxy.mjs.map +0 -1
  604. package/lib/deltaScheduler.d.mts.map +0 -1
  605. package/lib/deltaScheduler.mjs.map +0 -1
  606. package/lib/error.d.mts.map +0 -1
  607. package/lib/error.mjs.map +0 -1
  608. package/lib/gc/garbageCollection.d.mts.map +0 -1
  609. package/lib/gc/garbageCollection.mjs.map +0 -1
  610. package/lib/gc/gcConfigs.d.mts.map +0 -1
  611. package/lib/gc/gcConfigs.mjs.map +0 -1
  612. package/lib/gc/gcDefinitions.d.mts.map +0 -1
  613. package/lib/gc/gcDefinitions.mjs.map +0 -1
  614. package/lib/gc/gcHelpers.mjs.map +0 -1
  615. package/lib/gc/gcReferenceGraphAlgorithm.d.mts.map +0 -1
  616. package/lib/gc/gcReferenceGraphAlgorithm.mjs.map +0 -1
  617. package/lib/gc/gcSummaryDefinitions.d.mts.map +0 -1
  618. package/lib/gc/gcSummaryDefinitions.mjs.map +0 -1
  619. package/lib/gc/gcSummaryStateTracker.d.mts.map +0 -1
  620. package/lib/gc/gcSummaryStateTracker.mjs.map +0 -1
  621. package/lib/gc/gcTelemetry.d.mts.map +0 -1
  622. package/lib/gc/gcTelemetry.mjs.map +0 -1
  623. package/lib/gc/gcUnreferencedStateTracker.d.mts.map +0 -1
  624. package/lib/gc/gcUnreferencedStateTracker.mjs.map +0 -1
  625. package/lib/gc/index.d.mts +0 -13
  626. package/lib/gc/index.d.mts.map +0 -1
  627. package/lib/gc/index.mjs.map +0 -1
  628. package/lib/index.d.mts.map +0 -1
  629. package/lib/index.mjs +0 -25
  630. package/lib/index.mjs.map +0 -1
  631. package/lib/messageTypes.d.mts.map +0 -1
  632. package/lib/messageTypes.mjs.map +0 -1
  633. package/lib/metadata.d.mts.map +0 -1
  634. package/lib/metadata.mjs.map +0 -1
  635. package/lib/opLifecycle/batchManager.d.mts.map +0 -1
  636. package/lib/opLifecycle/batchManager.mjs.map +0 -1
  637. package/lib/opLifecycle/definitions.d.mts.map +0 -1
  638. package/lib/opLifecycle/definitions.mjs.map +0 -1
  639. package/lib/opLifecycle/index.d.mts +0 -13
  640. package/lib/opLifecycle/index.d.mts.map +0 -1
  641. package/lib/opLifecycle/index.mjs +0 -12
  642. package/lib/opLifecycle/index.mjs.map +0 -1
  643. package/lib/opLifecycle/opCompressor.d.mts.map +0 -1
  644. package/lib/opLifecycle/opCompressor.mjs.map +0 -1
  645. package/lib/opLifecycle/opDecompressor.d.mts.map +0 -1
  646. package/lib/opLifecycle/opDecompressor.mjs.map +0 -1
  647. package/lib/opLifecycle/opGroupingManager.d.mts.map +0 -1
  648. package/lib/opLifecycle/opGroupingManager.mjs.map +0 -1
  649. package/lib/opLifecycle/opSplitter.d.mts.map +0 -1
  650. package/lib/opLifecycle/opSplitter.mjs.map +0 -1
  651. package/lib/opLifecycle/outbox.d.mts.map +0 -1
  652. package/lib/opLifecycle/outbox.mjs.map +0 -1
  653. package/lib/opLifecycle/remoteMessageProcessor.d.mts.map +0 -1
  654. package/lib/opLifecycle/remoteMessageProcessor.mjs.map +0 -1
  655. package/lib/opProperties.d.mts.map +0 -1
  656. package/lib/opProperties.mjs.map +0 -1
  657. package/lib/packageVersion.d.mts.map +0 -1
  658. package/lib/packageVersion.mjs.map +0 -1
  659. package/lib/pendingStateManager.d.mts.map +0 -1
  660. package/lib/pendingStateManager.mjs.map +0 -1
  661. package/lib/scheduleManager.d.mts.map +0 -1
  662. package/lib/scheduleManager.mjs.map +0 -1
  663. package/lib/storageServiceWithAttachBlobs.d.mts.map +0 -1
  664. package/lib/storageServiceWithAttachBlobs.mjs.map +0 -1
  665. package/lib/summary/index.d.mts.map +0 -1
  666. package/lib/summary/index.mjs.map +0 -1
  667. package/lib/summary/orderedClientElection.d.mts.map +0 -1
  668. package/lib/summary/orderedClientElection.mjs.map +0 -1
  669. package/lib/summary/runWhileConnectedCoordinator.d.mts.map +0 -1
  670. package/lib/summary/runWhileConnectedCoordinator.mjs.map +0 -1
  671. package/lib/summary/runningSummarizer.d.mts.map +0 -1
  672. package/lib/summary/runningSummarizer.mjs.map +0 -1
  673. package/lib/summary/summarizer.d.mts.map +0 -1
  674. package/lib/summary/summarizer.mjs.map +0 -1
  675. package/lib/summary/summarizerClientElection.d.mts.map +0 -1
  676. package/lib/summary/summarizerClientElection.mjs.map +0 -1
  677. package/lib/summary/summarizerHeuristics.d.mts.map +0 -1
  678. package/lib/summary/summarizerHeuristics.mjs.map +0 -1
  679. package/lib/summary/summarizerNode/index.d.mts.map +0 -1
  680. package/lib/summary/summarizerNode/index.mjs +0 -7
  681. package/lib/summary/summarizerNode/index.mjs.map +0 -1
  682. package/lib/summary/summarizerNode/summarizerNode.d.mts.map +0 -1
  683. package/lib/summary/summarizerNode/summarizerNode.mjs.map +0 -1
  684. package/lib/summary/summarizerNode/summarizerNodeUtils.d.mts.map +0 -1
  685. package/lib/summary/summarizerNode/summarizerNodeUtils.mjs.map +0 -1
  686. package/lib/summary/summarizerNode/summarizerNodeWithGc.d.mts.map +0 -1
  687. package/lib/summary/summarizerNode/summarizerNodeWithGc.mjs.map +0 -1
  688. package/lib/summary/summarizerTypes.d.mts.map +0 -1
  689. package/lib/summary/summarizerTypes.mjs.map +0 -1
  690. package/lib/summary/summaryCollection.d.mts.map +0 -1
  691. package/lib/summary/summaryCollection.mjs.map +0 -1
  692. package/lib/summary/summaryFormat.d.mts.map +0 -1
  693. package/lib/summary/summaryFormat.mjs.map +0 -1
  694. package/lib/summary/summaryGenerator.d.mts.map +0 -1
  695. package/lib/summary/summaryGenerator.mjs.map +0 -1
  696. package/lib/summary/summaryManager.d.mts.map +0 -1
  697. package/lib/summary/summaryManager.mjs.map +0 -1
  698. package/lib/throttler.d.mts.map +0 -1
  699. package/lib/throttler.mjs.map +0 -1
  700. package/src/deltaManagerProxyBase.ts +0 -111
@@ -12,8 +12,8 @@ const driver_utils_1 = require("@fluidframework/driver-utils");
12
12
  const runtime_definitions_1 = require("@fluidframework/runtime-definitions");
13
13
  const runtime_utils_1 = require("@fluidframework/runtime-utils");
14
14
  const telemetry_utils_1 = require("@fluidframework/telemetry-utils");
15
- const summary_1 = require("./summary");
16
- const gc_1 = require("./gc");
15
+ const index_js_1 = require("./summary/index.js");
16
+ const index_js_2 = require("./gc/index.js");
17
17
  function createAttributes(pkg, isRootDataStore) {
18
18
  const stringifiedPkg = JSON.stringify(pkg);
19
19
  return {
@@ -24,11 +24,12 @@ function createAttributes(pkg, isRootDataStore) {
24
24
  }
25
25
  function createAttributesBlob(pkg, isRootDataStore) {
26
26
  const attributes = createAttributes(pkg, isRootDataStore);
27
- return new driver_utils_1.BlobTreeEntry(summary_1.dataStoreAttributesBlobName, JSON.stringify(attributes));
27
+ return new driver_utils_1.BlobTreeEntry(index_js_1.dataStoreAttributesBlobName, JSON.stringify(attributes));
28
28
  }
29
29
  exports.createAttributesBlob = createAttributesBlob;
30
30
  /**
31
31
  * Represents the context for the store. This context is passed to the store runtime.
32
+ * @internal
32
33
  */
33
34
  class FluidDataStoreContext extends client_utils_1.TypedEventEmitter {
34
35
  get packagePath() {
@@ -36,31 +37,31 @@ class FluidDataStoreContext extends client_utils_1.TypedEventEmitter {
36
37
  return this.pkg;
37
38
  }
38
39
  get options() {
39
- return this._containerRuntime.options;
40
+ return this.parentContext.options;
40
41
  }
41
42
  get clientId() {
42
- return this._containerRuntime.clientId;
43
+ return this.parentContext.clientId;
43
44
  }
44
45
  get clientDetails() {
45
- return this._containerRuntime.clientDetails;
46
+ return this.parentContext.clientDetails;
46
47
  }
47
48
  get logger() {
48
- return this._containerRuntime.logger;
49
+ return this.parentContext.logger;
49
50
  }
50
51
  get deltaManager() {
51
- return this._containerRuntime.deltaManager;
52
+ return this.parentContext.deltaManager;
52
53
  }
53
54
  get connected() {
54
- return this._containerRuntime.connected;
55
+ return this.parentContext.connected;
55
56
  }
56
57
  get IFluidHandleContext() {
57
- return this._containerRuntime.IFluidHandleContext;
58
+ return this.parentContext.IFluidHandleContext;
58
59
  }
59
60
  get containerRuntime() {
60
61
  return this._containerRuntime;
61
62
  }
62
63
  ensureNoDataModelChanges(callback) {
63
- return this._containerRuntime.ensureNoDataModelChanges(callback);
64
+ return this.parentContext.ensureNoDataModelChanges(callback);
64
65
  }
65
66
  get isLoaded() {
66
67
  return this.loaded;
@@ -69,7 +70,7 @@ class FluidDataStoreContext extends client_utils_1.TypedEventEmitter {
69
70
  return this._baseSnapshot;
70
71
  }
71
72
  get idCompressor() {
72
- return this._containerRuntime.idCompressor;
73
+ return this.parentContext.idCompressor;
73
74
  }
74
75
  get disposed() {
75
76
  return this._disposed;
@@ -119,18 +120,19 @@ class FluidDataStoreContext extends client_utils_1.TypedEventEmitter {
119
120
  this.loaded = false;
120
121
  this.pending = [];
121
122
  this._isInMemoryRoot = false;
122
- this._containerRuntime = props.runtime;
123
+ this._containerRuntime = props.parentContext.containerRuntime;
124
+ this.parentContext = props.parentContext;
123
125
  this.id = props.id;
124
126
  this.storage = props.storage;
125
127
  this.scope = props.scope;
126
128
  this.pkg = props.pkg;
127
- this.groupId = props.groupId;
129
+ this.loadingGroupId = props.loadingGroupId;
128
130
  // URIs use slashes as delimiters. Handles use URIs.
129
131
  // Thus having slashes in types almost guarantees trouble down the road!
130
132
  (0, core_utils_1.assert)(!this.id.includes("/"), 0x13a /* Data store ID contains slash */);
131
133
  this._attachState =
132
- this.containerRuntime.attachState !== container_definitions_1.AttachState.Detached && this.existing
133
- ? this.containerRuntime.attachState
134
+ this.parentContext.attachState !== container_definitions_1.AttachState.Detached && this.existing
135
+ ? this.parentContext.attachState
134
136
  : container_definitions_1.AttachState.Detached;
135
137
  const thisSummarizeInternal = async (fullTree, trackState, telemetryContext) => this.summarizeInternal(fullTree, trackState, telemetryContext);
136
138
  this.summarizerNode = props.createSummarizerNodeFn(thisSummarizeInternal, async (fullGC) => this.getGCDataInternal(fullGC));
@@ -147,7 +149,8 @@ class FluidDataStoreContext extends client_utils_1.TypedEventEmitter {
147
149
  },
148
150
  });
149
151
  this.thresholdOpsCounter = new telemetry_utils_1.ThresholdCounter(FluidDataStoreContext.pendingOpsCountThreshold, this.mc.logger);
150
- this.throwOnTombstoneUsage = this._containerRuntime.gcThrowOnTombstoneUsage;
152
+ this.gcThrowOnTombstoneUsage = this.parentContext.gcThrowOnTombstoneUsage;
153
+ this.gcTombstoneEnforcementAllowed = this.parentContext.gcTombstoneEnforcementAllowed;
151
154
  // By default, a data store can log maximum 10 local changes telemetry in summarizer.
152
155
  this.localChangesTelemetryCount =
153
156
  this.mc.config.getNumber("Fluid.Telemetry.LocalChangesTelemetryCount") ?? 10;
@@ -158,9 +161,9 @@ class FluidDataStoreContext extends client_utils_1.TypedEventEmitter {
158
161
  }
159
162
  this._disposed = true;
160
163
  // Dispose any pending runtime after it gets fulfilled
161
- // Errors are logged where this.channelDeferred is consumed/generated (realizeCore(), bindRuntime())
162
- if (this.channelDeferred) {
163
- this.channelDeferred.promise
164
+ // Errors are logged where this.channelP is consumed/generated (realizeCore(), bindRuntime())
165
+ if (this.channelP) {
166
+ this.channelP
164
167
  .then((runtime) => {
165
168
  runtime.dispose();
166
169
  })
@@ -189,27 +192,26 @@ class FluidDataStoreContext extends client_utils_1.TypedEventEmitter {
189
192
  }
190
193
  async realize() {
191
194
  (0, core_utils_1.assert)(!this.detachedRuntimeCreation, 0x13d /* "Detached runtime creation on realize()" */);
192
- if (!this.channelDeferred) {
193
- this.channelDeferred = new core_utils_1.Deferred();
194
- this.realizeCore(this.existing).catch((error) => {
195
+ if (!this.channelP) {
196
+ this.channelP = this.realizeCore(this.existing).catch((error) => {
195
197
  const errorWrapped = telemetry_utils_1.DataProcessingError.wrapIfUnrecognized(error, "realizeFluidDataStoreContext");
196
198
  errorWrapped.addTelemetryProperties((0, telemetry_utils_1.tagCodeArtifacts)({
197
199
  fullPackageName: this.pkg?.join("/"),
198
200
  fluidDataStoreId: this.id,
199
201
  }));
200
- this.channelDeferred?.reject(errorWrapped);
201
202
  this.mc.logger.sendErrorEvent({ eventName: "RealizeError" }, errorWrapped);
203
+ throw errorWrapped;
202
204
  });
203
205
  }
204
- return this.channelDeferred.promise;
206
+ return this.channelP;
205
207
  }
206
- async factoryFromPackagePath(packages) {
207
- (0, core_utils_1.assert)(this.pkg === packages, 0x13e /* "Unexpected package path" */);
208
+ async factoryFromPackagePath() {
209
+ const packages = this.pkg;
208
210
  if (packages === undefined) {
209
211
  this.rejectDeferredRealize("packages is undefined");
210
212
  }
211
213
  let entry;
212
- let registry = this._containerRuntime.IFluidDataStoreRegistry;
214
+ let registry = this.parentContext.IFluidDataStoreRegistry;
213
215
  let lastPkg;
214
216
  for (const pkg of packages) {
215
217
  if (!registry) {
@@ -226,7 +228,9 @@ class FluidDataStoreContext extends client_utils_1.TypedEventEmitter {
226
228
  if (factory === undefined) {
227
229
  this.rejectDeferredRealize("Can't find factory for package", lastPkg, packages);
228
230
  }
229
- return { factory, registry };
231
+ (0, core_utils_1.assert)(this.registry === undefined, 0x157 /* "datastore registry already attached" */);
232
+ this.registry = registry;
233
+ return factory;
230
234
  }
231
235
  async realizeCore(existing) {
232
236
  const details = await this.getInitialSnapshotDetails();
@@ -234,18 +238,18 @@ class FluidDataStoreContext extends client_utils_1.TypedEventEmitter {
234
238
  // It is important that this be in sync with the pending ops, and also
235
239
  // that it is set here, before bindRuntime is called.
236
240
  this._baseSnapshot = details.snapshot;
237
- const packages = details.pkg;
238
- const { factory, registry } = await this.factoryFromPackagePath(packages);
239
- (0, core_utils_1.assert)(this.registry === undefined, 0x13f /* "datastore context registry is already set" */);
240
- this.registry = registry;
241
+ this.baseSnapshotSequenceNumber = details.sequenceNumber;
242
+ (0, core_utils_1.assert)(this.pkg === details.pkg, 0x13e /* "Unexpected package path" */);
243
+ const factory = await this.factoryFromPackagePath();
241
244
  const channel = await factory.instantiateDataStore(this, existing);
242
245
  (0, core_utils_1.assert)(channel !== undefined, 0x140 /* "undefined channel on datastore context" */);
243
- this.bindRuntime(channel);
246
+ await this.bindRuntime(channel, existing);
244
247
  // This data store may have been disposed before the channel is created during realization. If so,
245
248
  // dispose the channel now.
246
249
  if (this.disposed) {
247
250
  channel.dispose();
248
251
  }
252
+ return channel;
249
253
  }
250
254
  /**
251
255
  * Notifies this object about changes in the connection state.
@@ -264,20 +268,14 @@ class FluidDataStoreContext extends client_utils_1.TypedEventEmitter {
264
268
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
265
269
  this.channel.setConnectionState(connected, clientId);
266
270
  }
267
- process(messageArg, local, localOpMetadata) {
268
- const safeTelemetryProps = (0, telemetry_utils_1.extractSafePropertiesFromMessage)(messageArg);
271
+ process(message, local, localOpMetadata) {
272
+ const safeTelemetryProps = (0, telemetry_utils_1.extractSafePropertiesFromMessage)(message);
269
273
  // On op process, tombstone error is logged in garbage collector. So, set "checkTombstone" to false when calling
270
274
  // "verifyNotClosed" which logs tombstone errors. Throw error if tombstoned and throwing on load is configured.
271
275
  this.verifyNotClosed("process", false /* checkTombstone */, safeTelemetryProps);
272
- if (this.tombstoned && this.throwOnTombstoneUsage) {
276
+ if (this.tombstoned && this.gcThrowOnTombstoneUsage) {
273
277
  throw new telemetry_utils_1.DataCorruptionError("Context is tombstoned! Call site [process]", safeTelemetryProps);
274
278
  }
275
- const innerContents = messageArg.contents;
276
- const message = {
277
- ...messageArg,
278
- type: innerContents.type,
279
- contents: innerContents.content,
280
- };
281
279
  this.summarizerNode.recordChange(message);
282
280
  if (this.loaded) {
283
281
  return this.channel?.process(message, local, localOpMetadata);
@@ -298,10 +296,10 @@ class FluidDataStoreContext extends client_utils_1.TypedEventEmitter {
298
296
  this.channel?.processSignal(message, local);
299
297
  }
300
298
  getQuorum() {
301
- return this._containerRuntime.getQuorum();
299
+ return this.parentContext.getQuorum();
302
300
  }
303
301
  getAudience() {
304
- return this._containerRuntime.getAudience();
302
+ return this.parentContext.getAudience();
305
303
  }
306
304
  /**
307
305
  * Returns a summary at the current sequence number.
@@ -317,19 +315,23 @@ class FluidDataStoreContext extends client_utils_1.TypedEventEmitter {
317
315
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
318
316
  const summarizeResult = await this.channel.summarize(fullTree, trackState, telemetryContext);
319
317
  // Wrap dds summaries in .channels subtree.
320
- (0, summary_1.wrapSummaryInChannelsTree)(summarizeResult);
318
+ (0, index_js_1.wrapSummaryInChannelsTree)(summarizeResult);
321
319
  const pathPartsForChildren = [runtime_definitions_1.channelsTreeName];
322
320
  // Add data store's attributes to the summary.
323
321
  const { pkg } = await this.getInitialSnapshotDetails();
324
322
  const isRoot = await this.isRoot();
325
323
  const attributes = createAttributes(pkg, isRoot);
326
- (0, runtime_utils_1.addBlobToSummary)(summarizeResult, summary_1.dataStoreAttributesBlobName, JSON.stringify(attributes));
324
+ (0, runtime_utils_1.addBlobToSummary)(summarizeResult, index_js_1.dataStoreAttributesBlobName, JSON.stringify(attributes));
327
325
  // If we are not referenced, mark the summary tree as unreferenced. Also, update unreferenced blob
328
326
  // size in the summary stats with the blobs size of this data store.
329
327
  if (!this.summarizerNode.isReferenced()) {
330
328
  summarizeResult.summary.unreferenced = true;
331
329
  summarizeResult.stats.unreferencedBlobSize = summarizeResult.stats.totalBlobSize;
332
330
  }
331
+ // Add loadingGroupId to the summary
332
+ if (this.loadingGroupId !== undefined) {
333
+ summarizeResult.summary.groupId = this.loadingGroupId;
334
+ }
333
335
  return {
334
336
  ...summarizeResult,
335
337
  id: this.id,
@@ -389,9 +391,11 @@ class FluidDataStoreContext extends client_utils_1.TypedEventEmitter {
389
391
  }
390
392
  }
391
393
  /**
392
- * @deprecated There is no replacement for this, its functionality is no longer needed.
394
+ * @deprecated There is no replacement for this, its functionality is no longer needed at this layer.
393
395
  * It will be removed in a future release, sometime after 2.0.0-internal.8.0.0
394
396
  *
397
+ * Similar capability is exposed with from/to string paths instead of handles via @see addedGCOutboundRoute
398
+ *
395
399
  * Called when a new outbound reference is added to another node. This is used by garbage collection to identify
396
400
  * all references added in the system.
397
401
  * @param srcHandle - The handle of the node that added the reference.
@@ -399,11 +403,23 @@ class FluidDataStoreContext extends client_utils_1.TypedEventEmitter {
399
403
  */
400
404
  addedGCOutboundReference(srcHandle, outboundHandle) {
401
405
  // By default, skip this call since the ContainerRuntime will detect the outbound route directly.
402
- if (this.mc.config.getBoolean(gc_1.detectOutboundRoutesViaDDSKey) === true) {
406
+ if (this.mc.config.getBoolean(index_js_2.detectOutboundRoutesViaDDSKey) === true) {
403
407
  // Note: The ContainerRuntime code will check this same setting to avoid double counting.
404
- this._containerRuntime.addedGCOutboundReference(srcHandle, outboundHandle);
408
+ this.parentContext.addedGCOutboundReference?.(srcHandle, outboundHandle);
405
409
  }
406
410
  }
411
+ /**
412
+ * (Same as @see addedGCOutboundReference, but with string paths instead of handles)
413
+ *
414
+ * Called when a new outbound reference is added to another node. This is used by garbage collection to identify
415
+ * all references added in the system.
416
+ *
417
+ * @param fromPath - The absolute path of the node that added the reference.
418
+ * @param toPath - The absolute path of the outbound node that is referenced.
419
+ */
420
+ addedGCOutboundRoute(fromPath, toPath) {
421
+ this.parentContext.addedGCOutboundReference?.({ absolutePath: fromPath }, { absolutePath: toPath });
422
+ }
407
423
  /**
408
424
  * Updates the used routes of the channel and its child contexts. The channel must be loaded before calling this.
409
425
  * It is called in these two scenarios:
@@ -433,13 +449,9 @@ class FluidDataStoreContext extends client_utils_1.TypedEventEmitter {
433
449
  submitMessage(type, content, localOpMetadata) {
434
450
  this.verifyNotClosed("submitMessage");
435
451
  (0, core_utils_1.assert)(!!this.channel, 0x146 /* "Channel must exist when submitting message" */);
436
- const fluidDataStoreContent = {
437
- content,
438
- type,
439
- };
440
452
  // Summarizer clients should not submit messages.
441
453
  this.identifyLocalChangeInSummarizer("DataStoreMessageSubmittedInSummarizer", type);
442
- this._containerRuntime.submitDataStoreOp(this.id, fluidDataStoreContent, localOpMetadata);
454
+ this.parentContext.submitMessage(type, content, localOpMetadata);
443
455
  }
444
456
  /**
445
457
  * This is called from a SharedSummaryBlock that does not generate ops but only wants to be part of the summary.
@@ -469,7 +481,7 @@ class FluidDataStoreContext extends client_utils_1.TypedEventEmitter {
469
481
  submitSignal(type, content, targetClientId) {
470
482
  this.verifyNotClosed("submitSignal");
471
483
  (0, core_utils_1.assert)(!!this.channel, 0x147 /* "Channel must exist on submitting signal" */);
472
- return this._containerRuntime.submitDataStoreSignal(this.id, type, content, targetClientId);
484
+ return this.parentContext.submitSignal(type, content, targetClientId);
473
485
  }
474
486
  /**
475
487
  * This is called by the data store channel when it becomes locally visible indicating that it is ready to become
@@ -477,54 +489,67 @@ class FluidDataStoreContext extends client_utils_1.TypedEventEmitter {
477
489
  */
478
490
  makeLocallyVisible() {
479
491
  (0, core_utils_1.assert)(this.channel !== undefined, 0x2cf /* "undefined channel on datastore context" */);
480
- (0, core_utils_1.assert)(this.channel.visibilityState === runtime_definitions_1.VisibilityState.LocallyVisible, 0x590 /* Channel must be locally visible */);
481
492
  this.makeLocallyVisibleFn();
482
493
  }
483
- bindRuntime(channel) {
484
- if (this.channel) {
485
- throw new Error("Runtime already bound");
486
- }
487
- try {
488
- (0, core_utils_1.assert)(!this.detachedRuntimeCreation, 0x148 /* "Detached runtime creation on runtime bind" */);
489
- (0, core_utils_1.assert)(this.channelDeferred !== undefined, 0x149 /* "Undefined channel deferral" */);
490
- (0, core_utils_1.assert)(this.pkg !== undefined, 0x14a /* "Undefined package path" */);
491
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
492
- const pending = this.pending;
493
- // Apply all pending ops
494
- for (const op of pending) {
494
+ processPendingOps(channel) {
495
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
496
+ const pending = this.pending;
497
+ // Apply all pending ops
498
+ for (const op of pending) {
499
+ // Only process ops whose seq number is greater than snapshot sequence number from which it loaded.
500
+ const seqNumber = this.baseSnapshotSequenceNumber ?? -1;
501
+ if (op.sequenceNumber > seqNumber) {
495
502
  channel.process(op, false, undefined /* localOpMetadata */);
496
503
  }
497
- this.thresholdOpsCounter.send("ProcessPendingOps", pending.length);
498
- this.pending = undefined;
499
- // And now mark the runtime active
500
- this.loaded = true;
501
- this.channel = channel;
502
- // Freeze the package path to ensure that someone doesn't modify it when it is
503
- // returned in packagePath().
504
- Object.freeze(this.pkg);
505
- /**
506
- * Update the used routes of the channel. If GC has run before this data store was realized, we will have
507
- * the used routes saved. So, this will ensure that all the child contexts have up-to-date used routes as
508
- * per the last time GC was run.
509
- * Also, this data store may have been realized during summarize. In that case, the child contexts need to
510
- * have their used routes updated to determine if its needs to summarize again and to add it to the summary.
511
- */
512
- this.updateChannelUsedRoutes();
513
- // And notify the pending promise it is now available
514
- this.channelDeferred.resolve(this.channel);
515
504
  }
516
- catch (error) {
517
- this.channelDeferred?.reject(error);
518
- this.mc.logger.sendErrorEvent({
519
- eventName: "BindRuntimeError",
520
- }, error);
505
+ this.pending = undefined;
506
+ this.thresholdOpsCounter.send("ProcessPendingOps", pending.length);
507
+ }
508
+ completeBindingRuntime(channel) {
509
+ // And now mark the runtime active
510
+ this.loaded = true;
511
+ this.channel = channel;
512
+ // Channel does not know when it's "live" (as in - starts to receive events in the system)
513
+ // It may read current state of the system when channel was created, but it was not getting any updates
514
+ // through creation process and could have missed events. So update it on current state.
515
+ // Once this.loaded is set (above), it will stat receiving events.
516
+ channel.setConnectionState(this.connected, this.clientId);
517
+ // Freeze the package path to ensure that someone doesn't modify it when it is
518
+ // returned in packagePath().
519
+ Object.freeze(this.pkg);
520
+ /**
521
+ * Update the used routes of the channel. If GC has run before this data store was realized, we will have
522
+ * the used routes saved. So, this will ensure that all the child contexts have up-to-date used routes as
523
+ * per the last time GC was run.
524
+ * Also, this data store may have been realized during summarize. In that case, the child contexts need to
525
+ * have their used routes updated to determine if its needs to summarize again and to add it to the summary.
526
+ */
527
+ this.updateChannelUsedRoutes();
528
+ }
529
+ async bindRuntime(channel, existing) {
530
+ if (this.channel) {
531
+ throw new Error("Runtime already bound");
521
532
  }
533
+ (0, core_utils_1.assert)(!this.detachedRuntimeCreation, 0x148 /* "Detached runtime creation on runtime bind" */);
534
+ (0, core_utils_1.assert)(this.pkg !== undefined, 0x14a /* "Undefined package path" */);
535
+ if (!existing) {
536
+ // Execute data store's entry point to make sure that for a local (aka detached from container) data store, the
537
+ // entryPoint initialization function is called before the data store gets attached and potentially connected to
538
+ // the delta stream, so it gets a chance to do things while the data store is still "purely local".
539
+ // This preserves the behavior from before we introduced entryPoints, where the instantiateDataStore method
540
+ // of data store factories tends to construct the data object (at least kick off an async method that returns
541
+ // it); that code moved to the entryPoint initialization function, so we want to ensure it still executes
542
+ // before the data store is attached.
543
+ await channel.entryPoint.get();
544
+ }
545
+ this.processPendingOps(channel);
546
+ this.completeBindingRuntime(channel);
522
547
  }
523
548
  async getAbsoluteUrl(relativeUrl) {
524
549
  if (this.attachState !== container_definitions_1.AttachState.Attached) {
525
550
  return undefined;
526
551
  }
527
- return this._containerRuntime.getAbsoluteUrl(relativeUrl);
552
+ return this.parentContext.getAbsoluteUrl(relativeUrl);
528
553
  }
529
554
  /**
530
555
  * @deprecated Sets the datastore as root, for aliasing purposes: #7948
@@ -540,20 +565,18 @@ class FluidDataStoreContext extends client_utils_1.TypedEventEmitter {
540
565
  async getBaseGCDetails() {
541
566
  return {};
542
567
  }
543
- reSubmit(contents, localOpMetadata) {
568
+ reSubmit(type, contents, localOpMetadata) {
544
569
  (0, core_utils_1.assert)(!!this.channel, 0x14b /* "Channel must exist when resubmitting ops" */);
545
- const innerContents = contents;
546
- this.channel.reSubmit(innerContents.type, innerContents.content, localOpMetadata);
570
+ this.channel.reSubmit(type, contents, localOpMetadata);
547
571
  }
548
- rollback(contents, localOpMetadata) {
572
+ rollback(type, contents, localOpMetadata) {
549
573
  if (!this.channel) {
550
574
  throw new Error("Channel must exist when rolling back ops");
551
575
  }
552
576
  if (!this.channel.rollback) {
553
577
  throw new Error("Channel doesn't support rollback");
554
578
  }
555
- const innerContents = contents;
556
- this.channel.rollback(innerContents.type, innerContents.content, localOpMetadata);
579
+ this.channel.rollback(type, contents, localOpMetadata);
557
580
  }
558
581
  async applyStashedOp(contents) {
559
582
  if (!this.channel) {
@@ -578,13 +601,13 @@ class FluidDataStoreContext extends client_utils_1.TypedEventEmitter {
578
601
  if (checkTombstone && this.tombstoned) {
579
602
  const messageString = `Context is tombstoned! Call site [${callSite}]`;
580
603
  const error = new telemetry_utils_1.DataCorruptionError(messageString, safeTelemetryProps);
581
- (0, gc_1.sendGCUnexpectedUsageEvent)(this.mc, {
604
+ (0, index_js_2.sendGCUnexpectedUsageEvent)(this.mc, {
582
605
  eventName: "GC_Tombstone_DataStore_Changed",
583
- category: this.throwOnTombstoneUsage ? "error" : "generic",
584
- gcTombstoneEnforcementAllowed: this._containerRuntime.gcTombstoneEnforcementAllowed,
606
+ category: this.gcThrowOnTombstoneUsage ? "error" : "generic",
607
+ gcTombstoneEnforcementAllowed: this.gcTombstoneEnforcementAllowed,
585
608
  callSite,
586
609
  }, this.pkg, error);
587
- if (this.throwOnTombstoneUsage) {
610
+ if (this.gcThrowOnTombstoneUsage) {
588
611
  throw error;
589
612
  }
590
613
  }
@@ -595,7 +618,7 @@ class FluidDataStoreContext extends client_utils_1.TypedEventEmitter {
595
618
  * other clients that are up-to-date till seq# 100 may not have them yet.
596
619
  */
597
620
  identifyLocalChangeInSummarizer(eventName, type) {
598
- if (this.clientDetails.type !== summary_1.summarizerClientType ||
621
+ if (this.clientDetails.type !== index_js_1.summarizerClientType ||
599
622
  this.localChangesTelemetryCount <= 0) {
600
623
  return;
601
624
  }
@@ -613,27 +636,40 @@ class FluidDataStoreContext extends client_utils_1.TypedEventEmitter {
613
636
  getCreateChildSummarizerNodeFn(id, createParam) {
614
637
  return (summarizeInternal, getGCDataFn) => this.summarizerNode.createChild(summarizeInternal, id, createParam, undefined /* config */, getGCDataFn);
615
638
  }
639
+ deleteChildSummarizerNode(id) {
640
+ this.summarizerNode.deleteChild(id);
641
+ }
616
642
  async uploadBlob(blob, signal) {
617
- return this.containerRuntime.uploadBlob(blob, signal);
643
+ return this.parentContext.uploadBlob(blob, signal);
618
644
  }
619
645
  }
620
646
  exports.FluidDataStoreContext = FluidDataStoreContext;
621
647
  FluidDataStoreContext.pendingOpsCountThreshold = 1000;
648
+ /** @internal */
622
649
  class RemoteFluidDataStoreContext extends FluidDataStoreContext {
623
650
  constructor(props) {
624
651
  super(props, true /* existing */, false /* isLocalDataStore */, () => {
625
652
  throw new Error("Already attached");
626
653
  });
627
654
  this.initialSnapshotDetailsP = new core_utils_1.LazyPromise(async () => {
628
- let tree = this.initSnapshotValue;
655
+ // Sequence number of the snapshot.
656
+ let sequenceNumber;
657
+ if (this.snapshotFetchRequired) {
658
+ (0, core_utils_1.assert)(this.loadingGroupId !== undefined, 0x8f5 /* groupId should be present to fetch snapshot */);
659
+ const snapshot = await this.runtime.getSnapshotForLoadingGroupId([this.loadingGroupId], [this.id]);
660
+ this._baseSnapshot = snapshot.snapshotTree;
661
+ sequenceNumber = snapshot.sequenceNumber;
662
+ this.snapshotFetchRequired = false;
663
+ }
664
+ let tree = this.baseSnapshot;
629
665
  let isRootDataStore = true;
630
- if (!!tree && tree.blobs[summary_1.dataStoreAttributesBlobName] !== undefined) {
666
+ if (!!tree && tree.blobs[index_js_1.dataStoreAttributesBlobName] !== undefined) {
631
667
  // Need to get through snapshot and use that to populate extraBlobs
632
- const attributes = await (0, driver_utils_1.readAndParse)(this.storage, tree.blobs[summary_1.dataStoreAttributesBlobName]);
668
+ const attributes = await (0, driver_utils_1.readAndParse)(this.storage, tree.blobs[index_js_1.dataStoreAttributesBlobName]);
633
669
  let pkgFromSnapshot;
634
670
  // Use the snapshotFormatVersion to determine how the pkg is encoded in the snapshot.
635
671
  // For snapshotFormatVersion = "0.1" (1) or above, pkg is jsonified, otherwise it is just a string.
636
- const formatVersion = (0, summary_1.getAttributesFormatVersion)(attributes);
672
+ const formatVersion = (0, index_js_1.getAttributesFormatVersion)(attributes);
637
673
  if (formatVersion < 1) {
638
674
  pkgFromSnapshot =
639
675
  attributes.pkg.startsWith('["') && attributes.pkg.endsWith('"]')
@@ -650,37 +686,55 @@ class RemoteFluidDataStoreContext extends FluidDataStoreContext {
650
686
  * roots in the document but they won't break.
651
687
  */
652
688
  isRootDataStore = attributes.isRootDataStore ?? true;
653
- if ((0, summary_1.hasIsolatedChannels)(attributes)) {
689
+ if ((0, index_js_1.hasIsolatedChannels)(attributes)) {
654
690
  tree = tree.trees[runtime_definitions_1.channelsTreeName];
655
691
  (0, core_utils_1.assert)(tree !== undefined, 0x1fe /* "isolated channels subtree should exist in remote datastore snapshot" */);
656
692
  }
657
693
  }
694
+ (0, core_utils_1.assert)(this.pkg !== undefined, 0x8f6 /* The datastore context package should be defined */);
658
695
  return {
659
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
660
696
  pkg: this.pkg,
661
697
  isRootDataStore,
662
698
  snapshot: tree,
699
+ sequenceNumber,
663
700
  };
664
701
  });
665
- this.initSnapshotValue = props.snapshotTree;
702
+ this._baseSnapshot = props.snapshotTree;
703
+ this.snapshotFetchRequired = !!props.snapshotTree?.omitted;
704
+ this.runtime = props.parentContext.containerRuntime;
666
705
  if (props.snapshotTree !== undefined) {
667
706
  this.summarizerNode.updateBaseSummaryState(props.snapshotTree);
668
707
  }
669
708
  }
709
+ /*
710
+ This API should not be called for RemoteFluidDataStoreContext. But here is one scenario where it's not the case:
711
+ The scenario (hit by stashedOps.spec.ts, "resends attach op" UT is the following (as far as I understand):
712
+ 1. data store is being attached in attached container
713
+ 2. container state is serialized (stashed ops feature)
714
+ 3. new container instance is rehydrated (from stashed ops)
715
+ - As result, we create RemoteFluidDataStoreContext for this data store that is actually in "attaching" state (as of # 2).
716
+ But its state is set to attached when loading container from stashed ops
717
+ 4. attach op for this data store is processed - setAttachState() is called.
718
+ */
719
+ setAttachState(attachState) { }
670
720
  async getInitialSnapshotDetails() {
671
721
  return this.initialSnapshotDetailsP;
672
722
  }
673
- generateAttachMessage() {
723
+ /**
724
+ * @see FluidDataStoreContext.getAttachData
725
+ */
726
+ getAttachData(includeGCData) {
674
727
  throw new Error("Cannot attach remote store");
675
728
  }
676
729
  }
677
730
  exports.RemoteFluidDataStoreContext = RemoteFluidDataStoreContext;
678
731
  /**
679
732
  * Base class for detached & attached context classes
733
+ * @internal
680
734
  */
681
735
  class LocalFluidDataStoreContextBase extends FluidDataStoreContext {
682
736
  constructor(props) {
683
- super(props, props.snapshotTree !== undefined ? true : false /* existing */, true /* isLocalDataStore */, props.makeLocallyVisibleFn);
737
+ super(props, props.snapshotTree !== undefined /* existing */, true /* isLocalDataStore */, props.makeLocallyVisibleFn);
684
738
  this.initialSnapshotDetailsP = new core_utils_1.LazyPromise(async () => {
685
739
  let snapshot = this.snapshotTree;
686
740
  let attributes;
@@ -688,8 +742,8 @@ class LocalFluidDataStoreContextBase extends FluidDataStoreContext {
688
742
  if (snapshot !== undefined) {
689
743
  // Get the dataStore attributes.
690
744
  // Note: storage can be undefined in special case while detached.
691
- attributes = await (0, summary_1.getFluidDataStoreAttributes)(this.storage, snapshot);
692
- if ((0, summary_1.hasIsolatedChannels)(attributes)) {
745
+ attributes = await (0, index_js_1.getFluidDataStoreAttributes)(this.storage, snapshot);
746
+ if ((0, index_js_1.hasIsolatedChannels)(attributes)) {
693
747
  snapshot = snapshot.trees[runtime_definitions_1.channelsTreeName];
694
748
  (0, core_utils_1.assert)(snapshot !== undefined, 0x1ff /* "isolated channels subtree should exist in local datastore snapshot" */);
695
749
  }
@@ -714,39 +768,73 @@ class LocalFluidDataStoreContextBase extends FluidDataStoreContext {
714
768
  // Summarizer client should not create local data stores.
715
769
  this.identifyLocalChangeInSummarizer("DataStoreCreatedInSummarizer");
716
770
  this.snapshotTree = props.snapshotTree;
717
- if (props.isRootDataStore === true) {
718
- this.setInMemoryRoot();
719
- }
720
771
  this.createProps = props.createProps;
721
- this.attachListeners();
722
772
  }
723
- attachListeners() {
724
- this.once("attaching", () => {
725
- (0, core_utils_1.assert)(this.attachState === container_definitions_1.AttachState.Detached, 0x14d /* "Should move from detached to attaching" */);
726
- this._attachState = container_definitions_1.AttachState.Attaching;
727
- });
728
- this.once("attached", () => {
729
- (0, core_utils_1.assert)(this.attachState === container_definitions_1.AttachState.Attaching, 0x14e /* "Should move from attaching to attached" */);
730
- this._attachState = container_definitions_1.AttachState.Attached;
731
- });
773
+ setAttachState(attachState) {
774
+ switch (attachState) {
775
+ case container_definitions_1.AttachState.Attaching:
776
+ (0, core_utils_1.assert)(this.attachState === container_definitions_1.AttachState.Detached, 0x14d /* "Should move from detached to attaching" */);
777
+ this._attachState = container_definitions_1.AttachState.Attaching;
778
+ if (this.channel?.setAttachState) {
779
+ this.channel.setAttachState(attachState);
780
+ }
781
+ else if (this.channel) {
782
+ // back-compat! To be removed in the future
783
+ // Added in "2.0.0-rc.2.0.0" timeframe.
784
+ this.emit("attaching");
785
+ }
786
+ break;
787
+ case container_definitions_1.AttachState.Attached:
788
+ // We can get called into here twice, as result of both container and data store being attached, if
789
+ // those processes overlapped, for example, in a flow like that one:
790
+ // 1. Container attach started
791
+ // 2. data store attachment started
792
+ // 3. container attached
793
+ // 4. data store attached.
794
+ if (this.attachState !== container_definitions_1.AttachState.Attached) {
795
+ (0, core_utils_1.assert)(this.attachState === container_definitions_1.AttachState.Attaching, 0x14e /* "Should move from attaching to attached" */);
796
+ this._attachState = container_definitions_1.AttachState.Attached;
797
+ this.channel?.setAttachState?.(attachState);
798
+ if (this.channel?.setAttachState) {
799
+ this.channel.setAttachState(attachState);
800
+ }
801
+ else if (this.channel) {
802
+ // back-compat! To be removed in the future
803
+ // Added in "2.0.0-rc.2.0.0" timeframe.
804
+ this.emit("attached");
805
+ }
806
+ }
807
+ break;
808
+ default:
809
+ (0, core_utils_1.unreachableCase)(attachState, "unreached");
810
+ }
732
811
  }
733
- generateAttachMessage() {
812
+ /**
813
+ * @see FluidDataStoreContext.getAttachData
814
+ */
815
+ getAttachData(includeGCData, telemetryContext) {
734
816
  (0, core_utils_1.assert)(this.channel !== undefined, 0x14f /* "There should be a channel when generating attach message" */);
735
817
  (0, core_utils_1.assert)(this.pkg !== undefined, 0x150 /* "pkg should be available in local data store context" */);
736
- const summarizeResult = this.channel.getAttachSummary();
818
+ const attachSummary = this.channel.getAttachSummary(telemetryContext);
737
819
  // Wrap dds summaries in .channels subtree.
738
- (0, summary_1.wrapSummaryInChannelsTree)(summarizeResult);
820
+ (0, index_js_1.wrapSummaryInChannelsTree)(attachSummary);
739
821
  // Add data store's attributes to the summary.
740
822
  const attributes = createAttributes(this.pkg, this.isInMemoryRoot());
741
- (0, runtime_utils_1.addBlobToSummary)(summarizeResult, summary_1.dataStoreAttributesBlobName, JSON.stringify(attributes));
742
- // Attach message needs the summary in ITree format. Convert the ISummaryTree into an ITree.
743
- const snapshot = (0, runtime_utils_1.convertSummaryTreeToITree)(summarizeResult.summary);
744
- const message = {
745
- id: this.id,
746
- snapshot,
823
+ (0, runtime_utils_1.addBlobToSummary)(attachSummary, index_js_1.dataStoreAttributesBlobName, JSON.stringify(attributes));
824
+ if (includeGCData) {
825
+ const gcData = this.channel.getAttachGCData?.(telemetryContext);
826
+ if (gcData !== undefined) {
827
+ (0, runtime_utils_1.addBlobToSummary)(attachSummary, runtime_definitions_1.gcDataBlobKey, JSON.stringify(gcData));
828
+ }
829
+ }
830
+ // Add loadingGroupId to the summary
831
+ if (this.loadingGroupId !== undefined) {
832
+ attachSummary.summary.groupId = this.loadingGroupId;
833
+ }
834
+ return {
835
+ attachSummary,
747
836
  type: this.pkg[this.pkg.length - 1],
748
837
  };
749
- return message;
750
838
  }
751
839
  async getInitialSnapshotDetails() {
752
840
  return this.initialSnapshotDetailsP;
@@ -760,7 +848,7 @@ class LocalFluidDataStoreContextBase extends FluidDataStoreContext {
760
848
  */
761
849
  delete() {
762
850
  // TODO: GC:Validation - potentially prevent this from happening or asserting. Maybe throw here.
763
- (0, gc_1.sendGCUnexpectedUsageEvent)(this.mc, {
851
+ (0, index_js_2.sendGCUnexpectedUsageEvent)(this.mc, {
764
852
  eventName: "GC_Deleted_DataStore_Unexpected_Delete",
765
853
  message: "Unexpected deletion of a local data store context",
766
854
  category: "error",
@@ -775,6 +863,7 @@ exports.LocalFluidDataStoreContextBase = LocalFluidDataStoreContextBase;
775
863
  * Various workflows (snapshot creation, requests) result in .realize() being called
776
864
  * on context, resulting in instantiation and attachment of runtime.
777
865
  * Runtime is created using data store factory that is associated with this context.
866
+ * @internal
778
867
  */
779
868
  class LocalFluidDataStoreContext extends LocalFluidDataStoreContextBase {
780
869
  constructor(props) {
@@ -792,29 +881,29 @@ class LocalDetachedFluidDataStoreContext extends LocalFluidDataStoreContextBase
792
881
  constructor(props) {
793
882
  super(props);
794
883
  this.detachedRuntimeCreation = true;
884
+ this.channelToDataStoreFn = props.channelToDataStoreFn;
795
885
  }
796
886
  async attachRuntime(registry, dataStoreChannel) {
797
887
  (0, core_utils_1.assert)(this.detachedRuntimeCreation, 0x154 /* "runtime creation is already attached" */);
798
888
  this.detachedRuntimeCreation = false;
799
- (0, core_utils_1.assert)(this.channelDeferred === undefined, 0x155 /* "channel deferral is already set" */);
800
- this.channelDeferred = new core_utils_1.Deferred();
801
- const factory = registry.IFluidDataStoreFactory;
802
- const entry = await this.factoryFromPackagePath(this.pkg);
803
- (0, core_utils_1.assert)(entry.factory === factory, 0x156 /* "Unexpected factory for package path" */);
804
- (0, core_utils_1.assert)(this.registry === undefined, 0x157 /* "datastore registry already attached" */);
805
- this.registry = entry.registry;
806
- super.bindRuntime(dataStoreChannel);
807
- // Load the handle to the data store's entryPoint to make sure that for a detached data store, the entryPoint
808
- // initialization function is called before the data store gets attached and potentially connected to the
809
- // delta stream, so it gets a chance to do things while the data store is still "purely local".
810
- // This preserves the behavior from before we introduced entryPoints, where the instantiateDataStore method
811
- // of data store factories tends to construct the data object (at least kick off an async method that returns
812
- // it); that code moved to the entryPoint initialization function, so we want to ensure it still executes
813
- // before the data store is attached.
814
- await dataStoreChannel.entryPoint.get();
815
- if (await this.isRoot()) {
816
- dataStoreChannel.makeVisibleAndAttachGraph();
817
- }
889
+ (0, core_utils_1.assert)(this.channelP === undefined, 0x155 /* "channel deferral is already set" */);
890
+ this.channelP = Promise.resolve()
891
+ .then(async () => {
892
+ const factory = registry.IFluidDataStoreFactory;
893
+ const factory2 = await this.factoryFromPackagePath();
894
+ (0, core_utils_1.assert)(factory2 === factory, 0x156 /* "Unexpected factory for package path" */);
895
+ await super.bindRuntime(dataStoreChannel, false /* existing */);
896
+ (0, core_utils_1.assert)(!(await this.isRoot()), 0x8f7 /* there are no more createRootDataStore() kind of APIs! */);
897
+ return dataStoreChannel;
898
+ })
899
+ .catch((error) => {
900
+ this.mc.logger.sendErrorEvent({ eventName: "AttachRuntimeError" }, error);
901
+ // The following two lines result in same exception thrown.
902
+ // But we need to ensure that this.channelDeferred.promise is "observed", as otherwise
903
+ // out UT reports unhandled exception
904
+ throw error;
905
+ });
906
+ return this.channelToDataStoreFn(await this.channelP);
818
907
  }
819
908
  async getInitialSnapshotDetails() {
820
909
  if (this.detachedRuntimeCreation) {