@fluidframework/container-runtime 2.0.0-dev-rc.1.0.0.228517 → 2.0.0-dev-rc.2.0.0.245554

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