@fluidframework/container-runtime 2.0.0-internal.7.3.0 → 2.0.0-internal.8.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (271) hide show
  1. package/CHANGELOG.md +50 -0
  2. package/api-extractor-lint.json +13 -0
  3. package/api-extractor.json +9 -1
  4. package/api-report/container-runtime.api.md +123 -123
  5. package/dist/blobManager.d.ts +4 -4
  6. package/dist/blobManager.d.ts.map +1 -1
  7. package/dist/blobManager.js.map +1 -1
  8. package/dist/container-runtime-alpha.d.ts +1444 -0
  9. package/dist/container-runtime-beta.d.ts +292 -0
  10. package/dist/container-runtime-public.d.ts +292 -0
  11. package/dist/container-runtime-untrimmed.d.ts +1792 -0
  12. package/dist/containerRuntime.d.ts +36 -66
  13. package/dist/containerRuntime.d.ts.map +1 -1
  14. package/dist/containerRuntime.js +68 -104
  15. package/dist/containerRuntime.js.map +1 -1
  16. package/dist/dataStore.js +0 -12
  17. package/dist/dataStore.js.map +1 -1
  18. package/dist/dataStoreRegistry.d.ts +1 -1
  19. package/dist/dataStoreRegistry.js +1 -1
  20. package/dist/dataStoreRegistry.js.map +1 -1
  21. package/dist/dataStores.d.ts +10 -15
  22. package/dist/dataStores.d.ts.map +1 -1
  23. package/dist/dataStores.js +77 -40
  24. package/dist/dataStores.js.map +1 -1
  25. package/dist/gc/garbageCollection.d.ts +41 -13
  26. package/dist/gc/garbageCollection.d.ts.map +1 -1
  27. package/dist/gc/garbageCollection.js +215 -78
  28. package/dist/gc/garbageCollection.js.map +1 -1
  29. package/dist/gc/gcConfigs.d.ts.map +1 -1
  30. package/dist/gc/gcConfigs.js +34 -37
  31. package/dist/gc/gcConfigs.js.map +1 -1
  32. package/dist/gc/gcDefinitions.d.ts +121 -46
  33. package/dist/gc/gcDefinitions.d.ts.map +1 -1
  34. package/dist/gc/gcDefinitions.js +26 -18
  35. package/dist/gc/gcDefinitions.js.map +1 -1
  36. package/dist/gc/gcHelpers.d.ts +18 -25
  37. package/dist/gc/gcHelpers.d.ts.map +1 -1
  38. package/dist/gc/gcHelpers.js +29 -45
  39. package/dist/gc/gcHelpers.js.map +1 -1
  40. package/dist/gc/gcTelemetry.d.ts +0 -5
  41. package/dist/gc/gcTelemetry.d.ts.map +1 -1
  42. package/dist/gc/gcTelemetry.js +14 -42
  43. package/dist/gc/gcTelemetry.js.map +1 -1
  44. package/dist/gc/gcUnreferencedStateTracker.d.ts +11 -5
  45. package/dist/gc/gcUnreferencedStateTracker.d.ts.map +1 -1
  46. package/dist/gc/gcUnreferencedStateTracker.js +43 -19
  47. package/dist/gc/gcUnreferencedStateTracker.js.map +1 -1
  48. package/dist/gc/index.d.ts +1 -1
  49. package/dist/gc/index.d.ts.map +1 -1
  50. package/dist/gc/index.js +4 -5
  51. package/dist/gc/index.js.map +1 -1
  52. package/dist/index.d.ts +15 -3
  53. package/dist/index.d.ts.map +1 -1
  54. package/dist/index.js +16 -6
  55. package/dist/index.js.map +1 -1
  56. package/dist/messageTypes.d.ts +15 -7
  57. package/dist/messageTypes.d.ts.map +1 -1
  58. package/dist/messageTypes.js +6 -1
  59. package/dist/messageTypes.js.map +1 -1
  60. package/dist/opLifecycle/definitions.d.ts +1 -1
  61. package/dist/opLifecycle/definitions.js.map +1 -1
  62. package/dist/packageVersion.d.ts +1 -1
  63. package/dist/packageVersion.js +1 -1
  64. package/dist/packageVersion.js.map +1 -1
  65. package/dist/pendingStateManager.d.ts +1 -0
  66. package/dist/pendingStateManager.d.ts.map +1 -1
  67. package/dist/pendingStateManager.js +1 -0
  68. package/dist/pendingStateManager.js.map +1 -1
  69. package/dist/summary/orderedClientElection.d.ts +1 -1
  70. package/dist/summary/orderedClientElection.js.map +1 -1
  71. package/dist/summary/runWhileConnectedCoordinator.d.ts +2 -2
  72. package/dist/summary/runWhileConnectedCoordinator.js +1 -1
  73. package/dist/summary/runWhileConnectedCoordinator.js.map +1 -1
  74. package/dist/summary/summarizer.d.ts +1 -13
  75. package/dist/summary/summarizer.d.ts.map +1 -1
  76. package/dist/summary/summarizer.js +1 -47
  77. package/dist/summary/summarizer.js.map +1 -1
  78. package/dist/summary/summarizerTypes.d.ts +30 -30
  79. package/dist/summary/summarizerTypes.js.map +1 -1
  80. package/dist/summary/summaryCollection.d.ts +10 -10
  81. package/dist/summary/summaryCollection.js +1 -1
  82. package/dist/summary/summaryCollection.js.map +1 -1
  83. package/dist/summary/summaryFormat.d.ts +3 -3
  84. package/dist/summary/summaryFormat.js.map +1 -1
  85. package/lib/blobManager.d.ts +4 -4
  86. package/lib/blobManager.d.ts.map +1 -1
  87. package/lib/blobManager.js.map +1 -1
  88. package/lib/container-runtime-alpha.d.ts +1444 -0
  89. package/lib/container-runtime-beta.d.ts +292 -0
  90. package/lib/container-runtime-public.d.ts +292 -0
  91. package/lib/container-runtime-untrimmed.d.ts +1792 -0
  92. package/lib/containerRuntime.d.ts +36 -66
  93. package/lib/containerRuntime.d.ts.map +1 -1
  94. package/lib/containerRuntime.js +69 -104
  95. package/lib/containerRuntime.js.map +1 -1
  96. package/lib/dataStore.js +0 -12
  97. package/lib/dataStore.js.map +1 -1
  98. package/lib/dataStoreRegistry.d.ts +1 -1
  99. package/lib/dataStoreRegistry.js +1 -1
  100. package/lib/dataStoreRegistry.js.map +1 -1
  101. package/lib/dataStores.d.ts +10 -15
  102. package/lib/dataStores.d.ts.map +1 -1
  103. package/lib/dataStores.js +80 -43
  104. package/lib/dataStores.js.map +1 -1
  105. package/lib/gc/garbageCollection.d.ts +41 -13
  106. package/lib/gc/garbageCollection.d.ts.map +1 -1
  107. package/lib/gc/garbageCollection.js +217 -80
  108. package/lib/gc/garbageCollection.js.map +1 -1
  109. package/lib/gc/gcConfigs.d.ts.map +1 -1
  110. package/lib/gc/gcConfigs.js +37 -40
  111. package/lib/gc/gcConfigs.js.map +1 -1
  112. package/lib/gc/gcDefinitions.d.ts +121 -46
  113. package/lib/gc/gcDefinitions.d.ts.map +1 -1
  114. package/lib/gc/gcDefinitions.js +25 -17
  115. package/lib/gc/gcDefinitions.js.map +1 -1
  116. package/lib/gc/gcHelpers.d.ts +18 -25
  117. package/lib/gc/gcHelpers.d.ts.map +1 -1
  118. package/lib/gc/gcHelpers.js +27 -43
  119. package/lib/gc/gcHelpers.js.map +1 -1
  120. package/lib/gc/gcTelemetry.d.ts +0 -5
  121. package/lib/gc/gcTelemetry.d.ts.map +1 -1
  122. package/lib/gc/gcTelemetry.js +15 -43
  123. package/lib/gc/gcTelemetry.js.map +1 -1
  124. package/lib/gc/gcUnreferencedStateTracker.d.ts +11 -5
  125. package/lib/gc/gcUnreferencedStateTracker.d.ts.map +1 -1
  126. package/lib/gc/gcUnreferencedStateTracker.js +43 -19
  127. package/lib/gc/gcUnreferencedStateTracker.js.map +1 -1
  128. package/lib/gc/index.d.ts +1 -1
  129. package/lib/gc/index.d.ts.map +1 -1
  130. package/lib/gc/index.js +1 -1
  131. package/lib/gc/index.js.map +1 -1
  132. package/lib/index.d.ts +15 -3
  133. package/lib/index.d.ts.map +1 -1
  134. package/lib/index.js +16 -2
  135. package/lib/index.js.map +1 -1
  136. package/lib/messageTypes.d.ts +15 -7
  137. package/lib/messageTypes.d.ts.map +1 -1
  138. package/lib/messageTypes.js +6 -1
  139. package/lib/messageTypes.js.map +1 -1
  140. package/lib/opLifecycle/definitions.d.ts +1 -1
  141. package/lib/opLifecycle/definitions.js.map +1 -1
  142. package/lib/packageVersion.d.ts +1 -1
  143. package/lib/packageVersion.js +1 -1
  144. package/lib/packageVersion.js.map +1 -1
  145. package/lib/pendingStateManager.d.ts +1 -0
  146. package/lib/pendingStateManager.d.ts.map +1 -1
  147. package/lib/pendingStateManager.js +1 -0
  148. package/lib/pendingStateManager.js.map +1 -1
  149. package/lib/summary/orderedClientElection.d.ts +1 -1
  150. package/lib/summary/orderedClientElection.js.map +1 -1
  151. package/lib/summary/runWhileConnectedCoordinator.d.ts +2 -2
  152. package/lib/summary/runWhileConnectedCoordinator.js +1 -1
  153. package/lib/summary/runWhileConnectedCoordinator.js.map +1 -1
  154. package/lib/summary/summarizer.d.ts +1 -13
  155. package/lib/summary/summarizer.d.ts.map +1 -1
  156. package/lib/summary/summarizer.js +1 -47
  157. package/lib/summary/summarizer.js.map +1 -1
  158. package/lib/summary/summarizerTypes.d.ts +30 -30
  159. package/lib/summary/summarizerTypes.js.map +1 -1
  160. package/lib/summary/summaryCollection.d.ts +10 -10
  161. package/lib/summary/summaryCollection.js +1 -1
  162. package/lib/summary/summaryCollection.js.map +1 -1
  163. package/lib/summary/summaryFormat.d.ts +3 -3
  164. package/lib/summary/summaryFormat.js.map +1 -1
  165. package/package.json +46 -19
  166. package/src/blobManager.ts +5 -5
  167. package/src/containerRuntime.ts +93 -141
  168. package/src/dataStore.ts +1 -15
  169. package/src/dataStoreRegistry.ts +1 -1
  170. package/src/dataStores.ts +140 -69
  171. package/src/gc/garbageCollection.md +14 -15
  172. package/src/gc/garbageCollection.ts +256 -96
  173. package/src/gc/gcConfigs.ts +50 -52
  174. package/src/gc/gcDefinitions.ts +137 -52
  175. package/src/gc/gcHelpers.ts +31 -52
  176. package/src/gc/gcTelemetry.ts +16 -57
  177. package/src/gc/gcUnreferencedStateTracker.ts +61 -22
  178. package/src/gc/index.ts +6 -4
  179. package/src/index.ts +19 -2
  180. package/src/messageTypes.ts +19 -4
  181. package/src/opLifecycle/definitions.ts +1 -1
  182. package/src/packageVersion.ts +1 -1
  183. package/src/pendingStateManager.ts +1 -0
  184. package/src/summary/orderedClientElection.ts +1 -1
  185. package/src/summary/runWhileConnectedCoordinator.ts +2 -2
  186. package/src/summary/summarizer.ts +2 -51
  187. package/src/summary/summarizerTypes.ts +30 -30
  188. package/src/summary/summaryCollection.ts +10 -10
  189. package/src/summary/summaryFormat.ts +3 -3
  190. package/dist/id-compressor/appendOnlySortedMap.d.ts +0 -124
  191. package/dist/id-compressor/appendOnlySortedMap.d.ts.map +0 -1
  192. package/dist/id-compressor/appendOnlySortedMap.js +0 -318
  193. package/dist/id-compressor/appendOnlySortedMap.js.map +0 -1
  194. package/dist/id-compressor/finalSpace.d.ts +0 -29
  195. package/dist/id-compressor/finalSpace.d.ts.map +0 -1
  196. package/dist/id-compressor/finalSpace.js +0 -62
  197. package/dist/id-compressor/finalSpace.js.map +0 -1
  198. package/dist/id-compressor/idCompressor.d.ts +0 -54
  199. package/dist/id-compressor/idCompressor.d.ts.map +0 -1
  200. package/dist/id-compressor/idCompressor.js +0 -495
  201. package/dist/id-compressor/idCompressor.js.map +0 -1
  202. package/dist/id-compressor/identifiers.d.ts +0 -32
  203. package/dist/id-compressor/identifiers.d.ts.map +0 -1
  204. package/dist/id-compressor/identifiers.js +0 -15
  205. package/dist/id-compressor/identifiers.js.map +0 -1
  206. package/dist/id-compressor/index.d.ts +0 -13
  207. package/dist/id-compressor/index.d.ts.map +0 -1
  208. package/dist/id-compressor/index.js +0 -32
  209. package/dist/id-compressor/index.js.map +0 -1
  210. package/dist/id-compressor/persistanceUtilities.d.ts +0 -22
  211. package/dist/id-compressor/persistanceUtilities.d.ts.map +0 -1
  212. package/dist/id-compressor/persistanceUtilities.js +0 -43
  213. package/dist/id-compressor/persistanceUtilities.js.map +0 -1
  214. package/dist/id-compressor/sessionSpaceNormalizer.d.ts +0 -46
  215. package/dist/id-compressor/sessionSpaceNormalizer.d.ts.map +0 -1
  216. package/dist/id-compressor/sessionSpaceNormalizer.js +0 -80
  217. package/dist/id-compressor/sessionSpaceNormalizer.js.map +0 -1
  218. package/dist/id-compressor/sessions.d.ts +0 -115
  219. package/dist/id-compressor/sessions.d.ts.map +0 -1
  220. package/dist/id-compressor/sessions.js +0 -305
  221. package/dist/id-compressor/sessions.js.map +0 -1
  222. package/dist/id-compressor/utilities.d.ts +0 -52
  223. package/dist/id-compressor/utilities.d.ts.map +0 -1
  224. package/dist/id-compressor/utilities.js +0 -169
  225. package/dist/id-compressor/utilities.js.map +0 -1
  226. package/lib/id-compressor/appendOnlySortedMap.d.ts +0 -124
  227. package/lib/id-compressor/appendOnlySortedMap.d.ts.map +0 -1
  228. package/lib/id-compressor/appendOnlySortedMap.js +0 -314
  229. package/lib/id-compressor/appendOnlySortedMap.js.map +0 -1
  230. package/lib/id-compressor/finalSpace.d.ts +0 -29
  231. package/lib/id-compressor/finalSpace.d.ts.map +0 -1
  232. package/lib/id-compressor/finalSpace.js +0 -58
  233. package/lib/id-compressor/finalSpace.js.map +0 -1
  234. package/lib/id-compressor/idCompressor.d.ts +0 -54
  235. package/lib/id-compressor/idCompressor.d.ts.map +0 -1
  236. package/lib/id-compressor/idCompressor.js +0 -491
  237. package/lib/id-compressor/idCompressor.js.map +0 -1
  238. package/lib/id-compressor/identifiers.d.ts +0 -32
  239. package/lib/id-compressor/identifiers.d.ts.map +0 -1
  240. package/lib/id-compressor/identifiers.js +0 -11
  241. package/lib/id-compressor/identifiers.js.map +0 -1
  242. package/lib/id-compressor/index.d.ts +0 -13
  243. package/lib/id-compressor/index.d.ts.map +0 -1
  244. package/lib/id-compressor/index.js +0 -13
  245. package/lib/id-compressor/index.js.map +0 -1
  246. package/lib/id-compressor/persistanceUtilities.d.ts +0 -22
  247. package/lib/id-compressor/persistanceUtilities.d.ts.map +0 -1
  248. package/lib/id-compressor/persistanceUtilities.js +0 -34
  249. package/lib/id-compressor/persistanceUtilities.js.map +0 -1
  250. package/lib/id-compressor/sessionSpaceNormalizer.d.ts +0 -46
  251. package/lib/id-compressor/sessionSpaceNormalizer.d.ts.map +0 -1
  252. package/lib/id-compressor/sessionSpaceNormalizer.js +0 -76
  253. package/lib/id-compressor/sessionSpaceNormalizer.js.map +0 -1
  254. package/lib/id-compressor/sessions.d.ts +0 -115
  255. package/lib/id-compressor/sessions.d.ts.map +0 -1
  256. package/lib/id-compressor/sessions.js +0 -290
  257. package/lib/id-compressor/sessions.js.map +0 -1
  258. package/lib/id-compressor/utilities.d.ts +0 -52
  259. package/lib/id-compressor/utilities.d.ts.map +0 -1
  260. package/lib/id-compressor/utilities.js +0 -151
  261. package/lib/id-compressor/utilities.js.map +0 -1
  262. package/src/id-compressor/README.md +0 -3
  263. package/src/id-compressor/appendOnlySortedMap.ts +0 -366
  264. package/src/id-compressor/finalSpace.ts +0 -67
  265. package/src/id-compressor/idCompressor.ts +0 -630
  266. package/src/id-compressor/identifiers.ts +0 -42
  267. package/src/id-compressor/index.ts +0 -26
  268. package/src/id-compressor/persistanceUtilities.ts +0 -58
  269. package/src/id-compressor/sessionSpaceNormalizer.ts +0 -83
  270. package/src/id-compressor/sessions.ts +0 -405
  271. package/src/id-compressor/utilities.ts +0 -190
@@ -0,0 +1,1792 @@
1
+ import { assertIsStableId } from '@fluidframework/id-compressor';
2
+ import { AttachState } from '@fluidframework/container-definitions';
3
+ import { ContainerWarning } from '@fluidframework/container-definitions';
4
+ import { FluidDataStoreRegistryEntry } from '@fluidframework/runtime-definitions';
5
+ import { FluidObject } from '@fluidframework/core-interfaces';
6
+ import { FlushMode } from '@fluidframework/runtime-definitions';
7
+ import { generateStableId } from '@fluidframework/id-compressor';
8
+ import { IAudience } from '@fluidframework/container-definitions';
9
+ import { IClientDetails } from '@fluidframework/protocol-definitions';
10
+ import { IContainerContext } from '@fluidframework/container-definitions';
11
+ import { IContainerRuntime } from '@fluidframework/container-runtime-definitions';
12
+ import { IContainerRuntimeEvents } from '@fluidframework/container-runtime-definitions';
13
+ import { ICriticalContainerError } from '@fluidframework/container-definitions';
14
+ import { IDataStore } from '@fluidframework/runtime-definitions';
15
+ import { IDeltaManager } from '@fluidframework/container-definitions';
16
+ import { IDisposable } from '@fluidframework/core-interfaces';
17
+ import { IDocumentMessage } from '@fluidframework/protocol-definitions';
18
+ import { IDocumentStorageService } from '@fluidframework/driver-definitions';
19
+ import { IEvent } from '@fluidframework/core-interfaces';
20
+ import { IEventProvider } from '@fluidframework/core-interfaces';
21
+ import { IFluidDataStoreContextDetached } from '@fluidframework/runtime-definitions';
22
+ import { IFluidDataStoreRegistry } from '@fluidframework/runtime-definitions';
23
+ import { IFluidHandle } from '@fluidframework/core-interfaces';
24
+ import { IFluidHandleContext } from '@fluidframework/core-interfaces';
25
+ import { IGarbageCollectionData } from '@fluidframework/runtime-definitions';
26
+ import { IGetPendingLocalStateProps } from '@fluidframework/container-definitions';
27
+ import type { IIdCompressor } from '@fluidframework/id-compressor';
28
+ import type { IIdCompressorCore } from '@fluidframework/id-compressor';
29
+ import { ILoaderOptions } from '@fluidframework/container-definitions';
30
+ import { IProvideFluidHandleContext } from '@fluidframework/core-interfaces';
31
+ import { IQuorumClients } from '@fluidframework/protocol-definitions';
32
+ import { IRequest } from '@fluidframework/core-interfaces';
33
+ import { IResponse } from '@fluidframework/core-interfaces';
34
+ import { IRuntime } from '@fluidframework/container-definitions';
35
+ import { ISequencedDocumentMessage } from '@fluidframework/protocol-definitions';
36
+ import { ISignalMessage } from '@fluidframework/protocol-definitions';
37
+ import { isStableId } from '@fluidframework/id-compressor';
38
+ import { ISummaryAck } from '@fluidframework/protocol-definitions';
39
+ import { ISummaryContent } from '@fluidframework/protocol-definitions';
40
+ import { ISummaryNack } from '@fluidframework/protocol-definitions';
41
+ import { ISummaryStats } from '@fluidframework/runtime-definitions';
42
+ import { ISummaryTree } from '@fluidframework/protocol-definitions';
43
+ import { ISummaryTreeWithStats } from '@fluidframework/runtime-definitions';
44
+ import { ITelemetryContext } from '@fluidframework/runtime-definitions';
45
+ import { ITelemetryLoggerExt } from '@fluidframework/telemetry-utils';
46
+ import { MessageType } from '@fluidframework/protocol-definitions';
47
+ import { NamedFluidDataStoreRegistryEntries } from '@fluidframework/runtime-definitions';
48
+ import { TypedEventEmitter } from '@fluid-internal/client-utils';
49
+
50
+ /**
51
+ * Legacy ID for the built-in AgentScheduler. To minimize disruption while removing it, retaining this as a
52
+ * special-case for document dirty state. Ultimately we should have no special-cases from the
53
+ * ContainerRuntime's perspective.
54
+ * @internal
55
+ */
56
+ export declare const agentSchedulerId = "_scheduler";
57
+
58
+ /**
59
+ * [IRRELEVANT IF throwOnInactiveLoad OPTION NOT SET] True if an inactive object should be returned without erroring
60
+ * @internal
61
+ */
62
+ export declare const AllowInactiveRequestHeaderKey = "allowInactive";
63
+
64
+ /** True if a tombstoned object should be returned without erroring
65
+ * @internal
66
+ */
67
+ export declare const AllowTombstoneRequestHeaderKey = "allowTombstone";
68
+
69
+ export { assertIsStableId }
70
+
71
+ /**
72
+ * How should an older client handle an unrecognized remote op type?
73
+ *
74
+ * @internal
75
+ */
76
+ export declare type CompatModeBehavior =
77
+ /** Ignore the op. It won't be persisted if this client summarizes */
78
+ "Ignore"
79
+ /** Fail processing immediately. (The container will close) */
80
+ | "FailToProcess";
81
+
82
+ /**
83
+ * Available compression algorithms for op compression.
84
+ * @alpha
85
+ */
86
+ export declare enum CompressionAlgorithms {
87
+ lz4 = "lz4"
88
+ }
89
+
90
+ /**
91
+ * @internal
92
+ */
93
+ export declare enum ContainerMessageType {
94
+ FluidDataStoreOp = "component",
95
+ Attach = "attach",
96
+ ChunkedOp = "chunkedOp",
97
+ BlobAttach = "blobAttach",
98
+ Rejoin = "rejoin",
99
+ Alias = "alias",
100
+ /**
101
+ * An op containing an IdRange of Ids allocated using the runtime's IdCompressor since
102
+ * the last allocation op was sent.
103
+ * See the [IdCompressor README](./id-compressor/README.md) for more details.
104
+ */
105
+ IdAllocation = "idAllocation",
106
+ /**
107
+ * Garbage collection specific op. This is sent by the summarizer client when GC runs. It's used to synchronize GC
108
+ * state across all clients.
109
+ */
110
+ GC = "GC"
111
+ }
112
+
113
+ /**
114
+ * Represents the runtime of the container. Contains helper functions/state of the container.
115
+ * It will define the store level mappings.
116
+ * @alpha
117
+ */
118
+ export declare class ContainerRuntime extends TypedEventEmitter<IContainerRuntimeEvents & ISummarizerEvents> implements IContainerRuntime, IRuntime, ISummarizerRuntime, ISummarizerInternalsProvider, IProvideFluidHandleContext {
119
+ private readonly registry;
120
+ private readonly runtimeOptions;
121
+ private readonly containerScope;
122
+ readonly logger: ITelemetryLoggerExt;
123
+ private readonly _storage;
124
+ private readonly requestHandler?;
125
+ private readonly summaryConfiguration;
126
+ /**
127
+ * Load the stores from a snapshot and returns the runtime.
128
+ * @param params - An object housing the runtime properties:
129
+ * - context - Context of the container.
130
+ * - registryEntries - Mapping from data store types to their corresponding factories.
131
+ * - existing - Pass 'true' if loading from an existing snapshot.
132
+ * - requestHandler - (optional) Request handler for the request() method of the container runtime.
133
+ * Only relevant for back-compat while we remove the request() method and move fully to entryPoint as the main pattern.
134
+ * - runtimeOptions - Additional options to be passed to the runtime
135
+ * - containerScope - runtime services provided with context
136
+ * - containerRuntimeCtor - Constructor to use to create the ContainerRuntime instance.
137
+ * This allows mixin classes to leverage this method to define their own async initializer.
138
+ * - provideEntryPoint - Promise that resolves to an object which will act as entryPoint for the Container.
139
+ * This object should provide all the functionality that the Container is expected to provide to the loader layer.
140
+ */
141
+ static loadRuntime(params: {
142
+ context: IContainerContext;
143
+ registryEntries: NamedFluidDataStoreRegistryEntries;
144
+ existing: boolean;
145
+ runtimeOptions?: IContainerRuntimeOptions;
146
+ containerScope?: FluidObject;
147
+ containerRuntimeCtor?: typeof ContainerRuntime;
148
+ /** @deprecated Will be removed once Loader LTS version is "2.0.0-internal.7.0.0". Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md */
149
+ requestHandler?: (request: IRequest, runtime: IContainerRuntime) => Promise<IResponse>;
150
+ provideEntryPoint: (containerRuntime: IContainerRuntime) => Promise<FluidObject>;
151
+ }): Promise<ContainerRuntime>;
152
+ readonly options: ILoaderOptions;
153
+ private imminentClosure;
154
+ private readonly _getClientId;
155
+ get clientId(): string | undefined;
156
+ readonly clientDetails: IClientDetails;
157
+ get storage(): IDocumentStorageService;
158
+ private readonly submitFn;
159
+ /**
160
+ * Although current IContainerContext guarantees submitBatchFn, it is not available on older loaders.
161
+ */
162
+ private readonly submitBatchFn;
163
+ private readonly submitSummaryFn;
164
+ private readonly submitSignalFn;
165
+ readonly disposeFn: (error?: ICriticalContainerError) => void;
166
+ readonly closeFn: (error?: ICriticalContainerError) => void;
167
+ get flushMode(): FlushMode;
168
+ get scope(): FluidObject;
169
+ get IFluidDataStoreRegistry(): IFluidDataStoreRegistry;
170
+ private readonly _getAttachState;
171
+ get attachState(): AttachState;
172
+ idCompressor: (IIdCompressor & IIdCompressorCore) | undefined;
173
+ get IFluidHandleContext(): IFluidHandleContext;
174
+ private readonly handleContext;
175
+ /**
176
+ * This is a proxy to the delta manager provided by the container context (innerDeltaManager). It restricts certain
177
+ * accesses such as sets "read-only" mode for the summarizer client. This is the default delta manager that should
178
+ * be used unless the innerDeltaManager is required.
179
+ */
180
+ readonly deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>;
181
+ /**
182
+ * The delta manager provided by the container context. By default, using the default delta manager (proxy)
183
+ * should be sufficient. This should be used only if necessary. For example, for validating and propagating connected
184
+ * events which requires access to the actual real only info, this is needed.
185
+ */
186
+ private readonly innerDeltaManager;
187
+ private readonly mc;
188
+ private readonly summarizerClientElection?;
189
+ /**
190
+ * summaryManager will only be created if this client is permitted to spawn a summarizing client
191
+ * It is created only by interactive client, i.e. summarizer client, as well as non-interactive bots
192
+ * do not create it (see SummarizerClientElection.clientDetailsPermitElection() for details)
193
+ */
194
+ private readonly summaryManager?;
195
+ private readonly summaryCollection;
196
+ private readonly summarizerNode;
197
+ private readonly maxConsecutiveReconnects;
198
+ private readonly defaultMaxConsecutiveReconnects;
199
+ private _orderSequentiallyCalls;
200
+ private readonly _flushMode;
201
+ private flushTaskExists;
202
+ private _connected;
203
+ private consecutiveReconnects;
204
+ /**
205
+ * Used to delay transition to "connected" state while we upload
206
+ * attachment blobs that were added while disconnected
207
+ */
208
+ private delayConnectClientId?;
209
+ private ensureNoDataModelChangesCalls;
210
+ /**
211
+ * Tracks the number of detected reentrant ops to report,
212
+ * in order to self-throttle the telemetry events.
213
+ *
214
+ * This should be removed as part of ADO:2322
215
+ */
216
+ private opReentryCallsToReport;
217
+ /**
218
+ * Invokes the given callback and expects that no ops are submitted
219
+ * until execution finishes. If an op is submitted, an error will be raised.
220
+ *
221
+ * Can be disabled by feature gate `Fluid.ContainerRuntime.DisableOpReentryCheck`
222
+ *
223
+ * @param callback - the callback to be invoked
224
+ */
225
+ ensureNoDataModelChanges<T>(callback: () => T): T;
226
+ get connected(): boolean;
227
+ /** clientId of parent (non-summarizing) container that owns summarizer container */
228
+ get summarizerClientId(): string | undefined;
229
+ private _disposed;
230
+ get disposed(): boolean;
231
+ private dirtyContainer;
232
+ private emitDirtyDocumentEvent;
233
+ private readonly enableOpReentryCheck;
234
+ private readonly disableAttachReorder;
235
+ private readonly closeSummarizerDelayMs;
236
+ /**
237
+ * If true, summary generated is validate before uploading it to the server. With single commit summaries,
238
+ * summaries will be accepted once uploaded, so they should be validated before upload. However, this can
239
+ * currently be controlled via a feature flag as its a new functionality.
240
+ */
241
+ private readonly validateSummaryBeforeUpload;
242
+ private readonly defaultTelemetrySignalSampleCount;
243
+ private readonly _perfSignalData;
244
+ /**
245
+ * Summarizer is responsible for coordinating when to send generate and send summaries.
246
+ * It is the main entry point for summary work.
247
+ * It is created only by summarizing container (i.e. one with clientType === "summarizer")
248
+ */
249
+ private readonly _summarizer?;
250
+ private readonly scheduleManager;
251
+ private readonly blobManager;
252
+ private readonly pendingStateManager;
253
+ private readonly outbox;
254
+ private readonly garbageCollector;
255
+ private readonly dataStores;
256
+ private readonly remoteMessageProcessor;
257
+ /** The last message processed at the time of the last summary. */
258
+ private messageAtLastSummary;
259
+ private get summarizer();
260
+ private readonly summariesDisabled;
261
+ private isSummariesDisabled;
262
+ private readonly heuristicsDisabled;
263
+ private isHeuristicsDisabled;
264
+ private readonly maxOpsSinceLastSummary;
265
+ private getMaxOpsSinceLastSummary;
266
+ private readonly initialSummarizerDelayMs;
267
+ private getInitialSummarizerDelayMs;
268
+ private readonly createContainerMetadata;
269
+ /**
270
+ * The summary number of the next summary that will be generated for this container. This is incremented every time
271
+ * a summary is generated.
272
+ */
273
+ private nextSummaryNumber;
274
+ /** If false, loading or using a Tombstoned object should merely log, not fail */
275
+ get gcTombstoneEnforcementAllowed(): boolean;
276
+ /** If true, throw an error when a tombstone data store is used. */
277
+ get gcThrowOnTombstoneUsage(): boolean;
278
+ /**
279
+ * GUID to identify a document in telemetry
280
+ * ! Note: should not be used for anything other than telemetry and is not considered a stable GUID
281
+ */
282
+ private readonly telemetryDocumentId;
283
+ /**
284
+ * If true, the runtime has access to an IdCompressor
285
+ */
286
+ private readonly idCompressorEnabled;
287
+ /**
288
+ * Whether this client is the summarizer client itself (type is summarizerClientType)
289
+ */
290
+ private readonly isSummarizerClient;
291
+ /**
292
+ * The id of the version used to initially load this runtime, or undefined if it's newly created.
293
+ */
294
+ private readonly loadedFromVersionId;
295
+ /***/
296
+ protected constructor(context: IContainerContext, registry: IFluidDataStoreRegistry, metadata: IContainerRuntimeMetadata | undefined, electedSummarizerData: ISerializedElection | undefined, chunks: [string, string[]][], dataStoreAliasMap: [string, string][], runtimeOptions: Readonly<Required<IContainerRuntimeOptions>>, containerScope: FluidObject, logger: ITelemetryLoggerExt, existing: boolean, blobManagerSnapshot: IBlobManagerLoadInfo, _storage: IDocumentStorageService, idCompressor: (IIdCompressor & IIdCompressorCore) | undefined, provideEntryPoint: (containerRuntime: IContainerRuntime) => Promise<FluidObject>, requestHandler?: ((request: IRequest, runtime: IContainerRuntime) => Promise<IResponse>) | undefined, summaryConfiguration?: ISummaryConfiguration);
297
+ /**
298
+ * Initializes the state from the base snapshot this container runtime loaded from.
299
+ */
300
+ private initializeBaseState;
301
+ dispose(error?: Error): void;
302
+ /**
303
+ * Notifies this object about the request made to the container.
304
+ * @param request - Request made to the handler.
305
+ * @deprecated Will be removed in future major release. This method needs to stay private until LTS version of Loader moves to "2.0.0-internal.7.0.0".
306
+ */
307
+ private request;
308
+ /**
309
+ * Resolves URI representing handle
310
+ * @param request - Request made to the handler.
311
+ */
312
+ resolveHandle(request: IRequest): Promise<IResponse>;
313
+ /**
314
+ * {@inheritDoc @fluidframework/container-definitions#IRuntime.getEntryPoint}
315
+ */
316
+ getEntryPoint(): Promise<FluidObject>;
317
+ private readonly entryPoint;
318
+ private internalId;
319
+ private getDataStoreFromRequest;
320
+ /** Adds the container's metadata to the given summary tree. */
321
+ private addMetadataToSummary;
322
+ protected addContainerStateToSummary(summaryTree: ISummaryTreeWithStats, fullTree: boolean, trackState: boolean, telemetryContext?: ITelemetryContext): void;
323
+ private shouldContinueReconnecting;
324
+ private resetReconnectCount;
325
+ private replayPendingStates;
326
+ /**
327
+ * Parse an op's type and actual content from given serialized content
328
+ * ! Note: this format needs to be in-line with what is set in the "ContainerRuntime.submit(...)" method
329
+ */
330
+ private parseLocalOpContent;
331
+ private applyStashedOp;
332
+ setConnectionState(connected: boolean, clientId?: string): void;
333
+ private setConnectionStateCore;
334
+ notifyOpReplay(message: ISequencedDocumentMessage): Promise<void>;
335
+ process(messageArg: ISequencedDocumentMessage, local: boolean): void;
336
+ private _processedClientSequenceNumber;
337
+ /**
338
+ * Direct the message to the correct subsystem for processing, and implement other side effects
339
+ */
340
+ private processCore;
341
+ /**
342
+ * Assuming the given message is also a TypedContainerRuntimeMessage,
343
+ * checks its type and dispatches the message to the appropriate handler in the runtime.
344
+ * Throws a DataProcessingError if the message looks like but doesn't conform to a known TypedContainerRuntimeMessage type.
345
+ */
346
+ private validateAndProcessRuntimeMessage;
347
+ /**
348
+ * Emits the Signal event and update the perf signal data.
349
+ * @param clientSignalSequenceNumber - is the client signal sequence number to be uploaded.
350
+ */
351
+ private sendSignalTelemetryEvent;
352
+ processSignal(message: ISignalMessage, local: boolean): void;
353
+ /**
354
+ * Flush the pending ops manually.
355
+ * This method is expected to be called at the end of a batch.
356
+ */
357
+ private flush;
358
+ orderSequentially<T>(callback: () => T): T;
359
+ /**
360
+ * Returns the aliased data store's entryPoint, given the alias.
361
+ * @param alias - The alias for the data store.
362
+ * @returns The data store's entry point ({@link @fluidframework/core-interfaces#IFluidHandle}) if it exists and is aliased.
363
+ * Returns undefined if no data store has been assigned the given alias.
364
+ */
365
+ getAliasedDataStoreEntryPoint(alias: string): Promise<IFluidHandle<FluidObject> | undefined>;
366
+ createDetachedRootDataStore(pkg: Readonly<string[]>, rootDataStoreId: string): IFluidDataStoreContextDetached;
367
+ createDetachedDataStore(pkg: Readonly<string[]>): IFluidDataStoreContextDetached;
368
+ createDataStore(pkg: string | string[]): Promise<IDataStore>;
369
+ /**
370
+ * @deprecated 0.16 Issue #1537, #3631
371
+ */
372
+ _createDataStoreWithProps(pkg: string | string[], props?: any, id?: string): Promise<IDataStore>;
373
+ private canSendOps;
374
+ /**
375
+ * Are we in the middle of batching ops together?
376
+ */
377
+ private currentlyBatching;
378
+ private readonly _quorum;
379
+ getQuorum(): IQuorumClients;
380
+ private readonly _audience;
381
+ getAudience(): IAudience;
382
+ /**
383
+ * Returns true of container is dirty, i.e. there are some pending local changes that
384
+ * either were not sent out to delta stream or were not yet acknowledged.
385
+ */
386
+ get isDirty(): boolean;
387
+ private isContainerMessageDirtyable;
388
+ private createNewSignalEnvelope;
389
+ /**
390
+ * Submits the signal to be sent to other clients.
391
+ * @param type - Type of the signal.
392
+ * @param content - Content of the signal.
393
+ * @param targetClientId - When specified, the signal is only sent to the provided client id.
394
+ */
395
+ submitSignal(type: string, content: any, targetClientId?: string): void;
396
+ /**
397
+ * Submits the signal to be sent to other clients.
398
+ * @param type - Type of the signal.
399
+ * @param content - Content of the signal.
400
+ * @param targetClientId - When specified, the signal is only sent to the provided client id.
401
+ */
402
+ submitDataStoreSignal(address: string, type: string, content: any, targetClientId?: string): void;
403
+ setAttachState(attachState: AttachState.Attaching | AttachState.Attached): void;
404
+ /**
405
+ * Create a summary. Used when attaching or serializing a detached container.
406
+ *
407
+ * @param blobRedirectTable - A table passed during the attach process. While detached, blob upload is supported
408
+ * using IDs generated locally. After attach, these IDs cannot be used, so this table maps the old local IDs to the
409
+ * new storage IDs so requests can be redirected.
410
+ * @param telemetryContext - summary data passed through the layers for telemetry purposes
411
+ */
412
+ createSummary(blobRedirectTable?: Map<string, string>, telemetryContext?: ITelemetryContext): ISummaryTree;
413
+ readonly getAbsoluteUrl: (relativeUrl: string) => Promise<string | undefined>;
414
+ private summarizeInternal;
415
+ /**
416
+ * Returns a summary of the runtime at the current sequence number.
417
+ */
418
+ summarize(options: {
419
+ /** True to generate the full tree with no handle reuse optimizations; defaults to false */
420
+ fullTree?: boolean;
421
+ /** True to track the state for this summary in the SummarizerNodes; defaults to true */
422
+ trackState?: boolean;
423
+ /** Logger to use for correlated summary events */
424
+ summaryLogger?: ITelemetryLoggerExt;
425
+ /** True to run garbage collection before summarizing; defaults to true */
426
+ runGC?: boolean;
427
+ /** True to generate full GC data */
428
+ fullGC?: boolean;
429
+ /** True to run GC sweep phase after the mark phase */
430
+ runSweep?: boolean;
431
+ }): Promise<ISummaryTreeWithStats>;
432
+ /**
433
+ * Before GC runs, called by the garbage collector to update any pending GC state. This is mainly used to notify
434
+ * the garbage collector of references detected since the last GC run. Most references are notified immediately
435
+ * but there can be some for which async operation is required (such as detecting new root data stores).
436
+ * @see IGarbageCollectionRuntime.updateStateBeforeGC
437
+ */
438
+ updateStateBeforeGC(): Promise<void>;
439
+ private getGCDataInternal;
440
+ /**
441
+ * Generates and returns the GC data for this container.
442
+ * @param fullGC - true to bypass optimizations and force full generation of GC data.
443
+ * @see IGarbageCollectionRuntime.getGCData
444
+ */
445
+ getGCData(fullGC?: boolean): Promise<IGarbageCollectionData>;
446
+ /**
447
+ * After GC has run, called to notify this container's nodes of routes that are used in it.
448
+ * @param usedRoutes - The routes that are used in all nodes in this Container.
449
+ * @see IGarbageCollectionRuntime.updateUsedRoutes
450
+ */
451
+ updateUsedRoutes(usedRoutes: readonly string[]): void;
452
+ /**
453
+ * This is called to update objects whose routes are unused.
454
+ * @param unusedRoutes - Data store and attachment blob routes that are unused in this Container.
455
+ */
456
+ updateUnusedRoutes(unusedRoutes: readonly string[]): void;
457
+ /**
458
+ * @deprecated Replaced by deleteSweepReadyNodes.
459
+ */
460
+ deleteUnusedNodes(unusedRoutes: readonly string[]): string[];
461
+ /**
462
+ * After GC has run and identified nodes that are sweep ready, this is called to delete the sweep ready nodes.
463
+ * @param sweepReadyRoutes - The routes of nodes that are sweep ready and should be deleted.
464
+ * @returns The routes of nodes that were deleted.
465
+ */
466
+ deleteSweepReadyNodes(sweepReadyRoutes: readonly string[]): readonly string[];
467
+ /**
468
+ * This is called to update objects that are tombstones.
469
+ * @param tombstonedRoutes - Data store and attachment blob routes that are tombstones in this Container.
470
+ */
471
+ updateTombstonedRoutes(tombstonedRoutes: readonly string[]): void;
472
+ /**
473
+ * Returns a server generated referenced timestamp to be used to track unreferenced nodes by GC.
474
+ */
475
+ getCurrentReferenceTimestampMs(): number | undefined;
476
+ /**
477
+ * Returns the type of the GC node. Currently, there are nodes that belong to the root ("/"), data stores or
478
+ * blob manager.
479
+ */
480
+ getNodeType(nodePath: string): GCNodeType;
481
+ /**
482
+ * Called by GC to retrieve the package path of the node with the given path. The node should belong to a
483
+ * data store or an attachment blob.
484
+ */
485
+ getGCNodePackagePath(nodePath: string): Promise<readonly string[] | undefined>;
486
+ /**
487
+ * Returns whether a given path is for attachment blobs that are in the format - "/BlobManager.basePath/...".
488
+ */
489
+ private isBlobPath;
490
+ /**
491
+ * From a given list of routes, separate and return routes that belong to blob manager and data stores.
492
+ * @param routes - A list of routes that can belong to data stores or blob manager.
493
+ * @returns Two route lists - One that contains routes for blob manager and another one that contains routes
494
+ * for data stores.
495
+ */
496
+ private getDataStoreAndBlobManagerRoutes;
497
+ /**
498
+ * Runs garbage collection and updates the reference / used state of the nodes in the container.
499
+ * @returns the statistics of the garbage collection run; undefined if GC did not run.
500
+ */
501
+ collectGarbage(options: {
502
+ /** Logger to use for logging GC events */
503
+ logger?: ITelemetryLoggerExt;
504
+ /** True to run GC sweep phase after the mark phase */
505
+ runSweep?: boolean;
506
+ /** True to generate full GC data */
507
+ fullGC?: boolean;
508
+ }, telemetryContext?: ITelemetryContext): Promise<IGCStats | undefined>;
509
+ /**
510
+ * Called when a new outbound reference is added to another node. This is used by garbage collection to identify
511
+ * all references added in the system.
512
+ * @param srcHandle - The handle of the node that added the reference.
513
+ * @param outboundHandle - The handle of the outbound node that is referenced.
514
+ */
515
+ addedGCOutboundReference(srcHandle: IFluidHandle, outboundHandle: IFluidHandle): void;
516
+ /**
517
+ * Generates the summary tree, uploads it to storage, and then submits the summarize op.
518
+ * This is intended to be called by the summarizer, since it is the implementation of
519
+ * ISummarizerInternalsProvider.submitSummary.
520
+ * It takes care of state management at the container level, including pausing inbound
521
+ * op processing, updating SummarizerNode state tracking, and garbage collection.
522
+ * @param options - options controlling how the summary is generated or submitted
523
+ */
524
+ submitSummary(options: ISubmitSummaryOptions): Promise<SubmitSummaryResult>;
525
+ /**
526
+ * This helper is called during summarization. If the container is dirty, it will return a failed summarize result
527
+ * (IBaseSummarizeResult) unless this is the final summarize attempt and SkipFailingIncorrectSummary option is set.
528
+ * @param logger - The logger to be used for sending telemetry.
529
+ * @param referenceSequenceNumber - The reference sequence number of the summary attempt.
530
+ * @param minimumSequenceNumber - The minimum sequence number of the summary attempt.
531
+ * @param finalAttempt - Whether this is the final summary attempt.
532
+ * @param beforeSummaryGeneration - Whether this is called before summary generation or after.
533
+ * @returns failed summarize result (IBaseSummarizeResult) if summary should be failed, undefined otherwise.
534
+ */
535
+ private shouldFailSummaryOnPendingOps;
536
+ private get pendingMessagesCount();
537
+ private hasPendingMessages;
538
+ private updateDocumentDirtyState;
539
+ submitDataStoreOp(id: string, contents: any, localOpMetadata?: unknown): void;
540
+ submitDataStoreAliasOp(contents: any, localOpMetadata: unknown): void;
541
+ uploadBlob(blob: ArrayBufferLike, signal?: AbortSignal): Promise<IFluidHandle<ArrayBufferLike>>;
542
+ private maybeSubmitIdAllocationOp;
543
+ private submit;
544
+ private scheduleFlush;
545
+ private submitSummaryMessage;
546
+ /**
547
+ * Throw an error if the runtime is closed. Methods that are expected to potentially
548
+ * be called after dispose due to asynchrony should not call this.
549
+ */
550
+ private verifyNotClosed;
551
+ private verifyCanSubmitOps;
552
+ private reSubmitBatch;
553
+ private reSubmit;
554
+ /**
555
+ * Finds the right store and asks it to resubmit the message. This typically happens when we
556
+ * reconnect and there are pending messages.
557
+ * ! Note: successfully resubmitting an op that has been successfully sequenced is not possible due to checks in the ConnectionStateHandler (Loader layer)
558
+ * @param message - The original LocalContainerRuntimeMessage.
559
+ * @param localOpMetadata - The local metadata associated with the original message.
560
+ */
561
+ private reSubmitCore;
562
+ private rollback;
563
+ /** Implementation of ISummarizerInternalsProvider.refreshLatestSummaryAck */
564
+ refreshLatestSummaryAck(options: IRefreshSummaryAckOptions): Promise<void>;
565
+ /**
566
+ * Fetches the latest snapshot from storage to refresh the cache as a performance optimization and closes the
567
+ * summarizer to reload from new state.
568
+ * @param summaryLogger - logger to use when fetching snapshot from storage
569
+ * @returns a generic summarization error
570
+ */
571
+ private prefetchLatestSummaryThenClose;
572
+ private closeStaleSummarizer;
573
+ /**
574
+ * Downloads the latest snapshot from storage.
575
+ * By default, it also closes the container after downloading the snapshot. However, this may be
576
+ * overridden via options.
577
+ */
578
+ private fetchLatestSnapshotFromStorage;
579
+ getPendingLocalState(props?: IGetPendingLocalStateProps): Promise<unknown>;
580
+ summarizeOnDemand(options: IOnDemandSummarizeOptions): ISummarizeResults;
581
+ enqueueSummarize(options: IEnqueueSummarizeOptions): EnqueueSummarizeResult;
582
+ /**
583
+ * Forms a function that will create and retrieve a Summarizer.
584
+ */
585
+ private formCreateSummarizerFn;
586
+ private validateSummaryHeuristicConfiguration;
587
+ private get groupedBatchingEnabled();
588
+ }
589
+
590
+ /**
591
+ * The unpacked runtime message / details to be handled or dispatched by the ContainerRuntime
592
+ *
593
+ * IMPORTANT: when creating one to be serialized, set the properties in the order they appear here.
594
+ * This way stringified values can be compared.
595
+ *
596
+ * @deprecated this is an internal type which should not be used outside of the package.
597
+ * Internally, it is superseded by `TypedContainerRuntimeMessage`.
598
+ *
599
+ * @internal
600
+ */
601
+ export declare interface ContainerRuntimeMessage {
602
+ /** Type of the op, within the ContainerRuntime's domain */
603
+ type: ContainerMessageType;
604
+ /** Domain-specific contents, interpreted according to the type */
605
+ contents: any;
606
+ /** Info describing how to handle this op in case the type is unrecognized (default: fail to process) */
607
+ compatDetails?: IContainerRuntimeMessageCompatDetails;
608
+ }
609
+
610
+ /**
611
+ * @internal
612
+ */
613
+ export declare const DefaultSummaryConfiguration: ISummaryConfiguration;
614
+
615
+ /**
616
+ * @alpha
617
+ */
618
+ export declare type EnqueueSummarizeResult = (ISummarizeResults & {
619
+ /**
620
+ * Indicates that another summarize attempt is not already enqueued,
621
+ * and this attempt has been enqueued.
622
+ */
623
+ readonly alreadyEnqueued?: undefined;
624
+ }) | (ISummarizeResults & {
625
+ /** Indicates that another summarize attempt was already enqueued. */
626
+ readonly alreadyEnqueued: true;
627
+ /**
628
+ * Indicates that the other enqueued summarize attempt was abandoned,
629
+ * and this attempt has been enqueued enqueued.
630
+ */
631
+ readonly overridden: true;
632
+ }) | {
633
+ /** Indicates that another summarize attempt was already enqueued. */
634
+ readonly alreadyEnqueued: true;
635
+ /**
636
+ * Indicates that the other enqueued summarize attempt remains enqueued,
637
+ * and this attempt has not been enqueued.
638
+ */
639
+ readonly overridden?: undefined;
640
+ };
641
+
642
+ /**
643
+ * @internal
644
+ */
645
+ export declare class FluidDataStoreRegistry implements IFluidDataStoreRegistry {
646
+ private readonly map;
647
+ get IFluidDataStoreRegistry(): this;
648
+ constructor(namedEntries: NamedFluidDataStoreRegistryEntries);
649
+ get(name: string): Promise<FluidDataStoreRegistryEntry | undefined>;
650
+ }
651
+
652
+ /**
653
+ * @see IGCMetadata.gcFeatureMatrix and @see gcGenerationOptionName
654
+ * @alpha
655
+ */
656
+ export declare type GCFeatureMatrix = {
657
+ /**
658
+ * The GC Generation value in effect when this file was created.
659
+ * Gives a way for an app to disqualify old files from GC Sweep.
660
+ * Provided via Container Runtime Options.
661
+ */
662
+ gcGeneration?: number;
663
+ /** Deprecated property from legacy type. Will not be set concurrently with gcGeneration */
664
+ tombstoneGeneration?: undefined;
665
+ } | {
666
+ /**
667
+ * The Tombstone Generation value in effect when this file was created.
668
+ * Legacy - new containers would get gcGeneration instead (if anything)
669
+ */
670
+ tombstoneGeneration: number;
671
+ };
672
+
673
+ /**
674
+ * The types of GC nodes in the GC reference graph.
675
+ * @alpha
676
+ */
677
+ export declare const GCNodeType: {
678
+ DataStore: string;
679
+ SubDataStore: string;
680
+ Blob: string;
681
+ Other: string;
682
+ };
683
+
684
+ /**
685
+ * @alpha
686
+ */
687
+ export declare type GCNodeType = (typeof GCNodeType)[keyof typeof GCNodeType];
688
+
689
+ /**
690
+ * @alpha
691
+ */
692
+ export declare type GCVersion = number;
693
+
694
+ export { generateStableId }
695
+
696
+ /**
697
+ * A single summary which has already been acked by the server.
698
+ * @internal
699
+ */
700
+ export declare interface IAckedSummary {
701
+ readonly summaryOp: ISummaryOpMessage;
702
+ readonly summaryAck: ISummaryAckMessage;
703
+ }
704
+
705
+ /**
706
+ * @alpha
707
+ */
708
+ export declare interface IAckSummaryResult {
709
+ readonly summaryAckOp: ISummaryAckMessage;
710
+ readonly ackNackDuration: number;
711
+ }
712
+
713
+ /**
714
+ * Base results for all submitSummary attempts.
715
+ * @alpha
716
+ */
717
+ export declare interface IBaseSummarizeResult {
718
+ readonly stage: "base";
719
+ /** Error object related to failed summarize attempt. */
720
+ readonly error: any;
721
+ /** Reference sequence number as of the generate summary attempt. */
722
+ readonly referenceSequenceNumber: number;
723
+ readonly minimumSequenceNumber: number;
724
+ }
725
+
726
+ /**
727
+ * Information from a snapshot needed to load BlobManager
728
+ * @alpha
729
+ */
730
+ export declare interface IBlobManagerLoadInfo {
731
+ ids?: string[];
732
+ redirectTable?: [string, string][];
733
+ }
734
+
735
+ /**
736
+ * @alpha
737
+ */
738
+ export declare interface IBroadcastSummaryResult {
739
+ readonly summarizeOp: ISummaryOpMessage;
740
+ readonly broadcastDuration: number;
741
+ }
742
+
743
+ /**
744
+ * Similar to AbortController, but using promise instead of events
745
+ * @internal
746
+ */
747
+ export declare interface ICancellableSummarizerController extends ISummaryCancellationToken {
748
+ stop(reason: SummarizerStopReason): void;
749
+ }
750
+
751
+ /**
752
+ * Similar to AbortSignal, but using promise instead of events
753
+ * @param T - cancellation reason type
754
+ * @alpha
755
+ */
756
+ export declare interface ICancellationToken<T> {
757
+ /** Tells if this cancellable token is cancelled */
758
+ readonly cancelled: boolean;
759
+ /**
760
+ * Promise that gets fulfilled when this cancellable token is cancelled
761
+ * @returns reason of cancellation
762
+ */
763
+ readonly waitCancelled: Promise<T>;
764
+ }
765
+
766
+ /**
767
+ * @internal
768
+ */
769
+ export declare interface IChunkedOp {
770
+ chunkId: number;
771
+ totalChunks: number;
772
+ contents: string;
773
+ originalType: MessageType | ContainerMessageType;
774
+ originalMetadata?: Record<string, unknown>;
775
+ originalCompression?: string;
776
+ }
777
+
778
+ /**
779
+ * Watches summaries created by a specific client.
780
+ * @internal
781
+ */
782
+ export declare interface IClientSummaryWatcher extends IDisposable {
783
+ watchSummary(clientSequenceNumber: number): ISummary;
784
+ waitFlushed(): Promise<IAckedSummary | undefined>;
785
+ }
786
+
787
+ /**
788
+ * Options for op compression.
789
+ * @alpha
790
+ */
791
+ export declare interface ICompressionRuntimeOptions {
792
+ /**
793
+ * The value the batch's content size must exceed for the batch to be compressed.
794
+ * By default the value is 600 * 1024 = 614400 bytes. If the value is set to `Infinity`, compression will be disabled.
795
+ */
796
+ readonly minimumBatchSizeInBytes: number;
797
+ /**
798
+ * The compression algorithm that will be used to compress the op.
799
+ * By default the value is `lz4` which is the only compression algorithm currently supported.
800
+ */
801
+ readonly compressionAlgorithm: CompressionAlgorithms;
802
+ }
803
+
804
+ /**
805
+ * @alpha
806
+ */
807
+ export declare interface IConnectableRuntime {
808
+ readonly disposed: boolean;
809
+ readonly connected: boolean;
810
+ readonly clientId: string | undefined;
811
+ once(event: "connected" | "disconnected" | "dispose", listener: () => void): this;
812
+ }
813
+
814
+ /**
815
+ * All the info an older client would need to know how to handle an unrecognized remote op type
816
+ *
817
+ * @internal
818
+ */
819
+ export declare interface IContainerRuntimeMessageCompatDetails {
820
+ /** How should an older client handle an unrecognized remote op type? */
821
+ behavior: CompatModeBehavior;
822
+ }
823
+
824
+ /**
825
+ * @alpha
826
+ */
827
+ export declare interface IContainerRuntimeMetadata extends ICreateContainerMetadata, IGCMetadata {
828
+ readonly summaryFormatVersion: 1;
829
+ /** The last message processed at the time of summary. Only primitive property types are added to the summary. */
830
+ readonly message: ISummaryMetadataMessage | undefined;
831
+ /** True if channels are not isolated in .channels subtrees, otherwise isolated. */
832
+ readonly disableIsolatedChannels?: true;
833
+ /** The summary number for a container's summary. Incremented on summaries throughout its lifetime. */
834
+ readonly summaryNumber?: number;
835
+ /** GUID to identify a document in telemetry */
836
+ readonly telemetryDocumentId?: string;
837
+ /** True if the runtime IdCompressor is enabled */
838
+ readonly idCompressorEnabled?: boolean;
839
+ }
840
+
841
+ /**
842
+ * Options for container runtime.
843
+ * @alpha
844
+ */
845
+ export declare interface IContainerRuntimeOptions {
846
+ readonly summaryOptions?: ISummaryRuntimeOptions;
847
+ readonly gcOptions?: IGCRuntimeOptions;
848
+ /**
849
+ * Affects the behavior while loading the runtime when the data verification check which
850
+ * compares the DeltaManager sequence number (obtained from protocol in summary) to the
851
+ * runtime sequence number (obtained from runtime metadata in summary) finds a mismatch.
852
+ * 1. "close" (default) will close the container with an assertion.
853
+ * 2. "log" will log an error event to telemetry, but still continue to load.
854
+ * 3. "bypass" will skip the check entirely. This is not recommended.
855
+ */
856
+ readonly loadSequenceNumberVerification?: "close" | "log" | "bypass";
857
+ /**
858
+ * Sets the flush mode for the runtime. In Immediate flush mode the runtime will immediately
859
+ * send all operations to the driver layer, while in TurnBased the operations will be buffered
860
+ * and then sent them as a single batch at the end of the turn.
861
+ * By default, flush mode is TurnBased.
862
+ */
863
+ readonly flushMode?: FlushMode;
864
+ /**
865
+ * Enables the runtime to compress ops. See {@link ICompressionRuntimeOptions}.
866
+ */
867
+ readonly compressionOptions?: ICompressionRuntimeOptions;
868
+ /**
869
+ * If specified, when in FlushMode.TurnBased, if the size of the ops between JS turns exceeds this value,
870
+ * an error will be thrown and the container will close.
871
+ *
872
+ * If unspecified, the limit is 950 * 1024.
873
+ *
874
+ * 'Infinity' will disable any limit.
875
+ *
876
+ * @experimental This config should be driven by the connection with the service and will be moved in the future.
877
+ */
878
+ readonly maxBatchSizeInBytes?: number;
879
+ /**
880
+ * If the op payload needs to be chunked in order to work around the maximum size of the batch, this value represents
881
+ * how large the individual chunks will be. This is only supported when compression is enabled. If after compression, the
882
+ * batch content size exceeds this value, it will be chunked into smaller ops of this exact size.
883
+ *
884
+ * This value is a trade-off between having many small chunks vs fewer larger chunks and by default, the runtime is configured to use
885
+ * 200 * 1024 = 204800 bytes. This default value ensures that no compressed payload's content is able to exceed {@link IContainerRuntimeOptions.maxBatchSizeInBytes}
886
+ * regardless of the overhead of an individual op.
887
+ *
888
+ * Any value of `chunkSizeInBytes` exceeding {@link IContainerRuntimeOptions.maxBatchSizeInBytes} will disable this feature, therefore if a compressed batch's content
889
+ * size exceeds {@link IContainerRuntimeOptions.maxBatchSizeInBytes} after compression, the container will close with an instance of `GenericError` with
890
+ * the `BatchTooLarge` message.
891
+ */
892
+ readonly chunkSizeInBytes?: number;
893
+ /**
894
+ * Enable the IdCompressor in the runtime.
895
+ * @experimental Not ready for use.
896
+ */
897
+ readonly enableRuntimeIdCompressor?: boolean;
898
+ /**
899
+ * If enabled, the runtime will block all attempts to send an op inside the
900
+ * {@link ContainerRuntime#ensureNoDataModelChanges} callback. The callback is used by
901
+ * {@link @fluidframework/shared-object-base#SharedObjectCore} for event handlers so enabling this
902
+ * will disallow modifying DDSes while handling DDS events.
903
+ *
904
+ * By default, the feature is disabled. If enabled from options, the `Fluid.ContainerRuntime.DisableOpReentryCheck`
905
+ * can be used to disable it at runtime.
906
+ */
907
+ readonly enableOpReentryCheck?: boolean;
908
+ /**
909
+ * If enabled, the runtime will group messages within a batch into a single
910
+ * message to be sent to the service.
911
+ * The grouping an ungrouping of such messages is handled by the "OpGroupingManager".
912
+ *
913
+ * By default, the feature is disabled. If enabled from options, the `Fluid.ContainerRuntime.DisableGroupedBatching`
914
+ * flag can be used to disable it at runtime.
915
+ *
916
+ * @experimental Not ready for use.
917
+ */
918
+ readonly enableGroupedBatching?: boolean;
919
+ }
920
+
921
+ /**
922
+ * @alpha
923
+ */
924
+ export declare interface ICreateContainerMetadata {
925
+ /** Runtime version of the container when it was first created */
926
+ createContainerRuntimeVersion?: string;
927
+ /** Timestamp of the container when it was first created */
928
+ createContainerTimestamp?: number;
929
+ }
930
+
931
+ /**
932
+ * Options to use when enqueueing a summarize attempt.
933
+ * @alpha
934
+ */
935
+ export declare interface IEnqueueSummarizeOptions extends IOnDemandSummarizeOptions {
936
+ /** If specified, The summarize attempt will not occur until after this sequence number. */
937
+ readonly afterSequenceNumber?: number;
938
+ /**
939
+ * True to override the existing enqueued summarize attempt if there is one.
940
+ * This will guarantee that this attempt gets enqueued. If override is false,
941
+ * than an existing enqueued summarize attempt will block a new one from being
942
+ * enqueued. There can only be one enqueued at a time. Defaults to false.
943
+ */
944
+ readonly override?: boolean;
945
+ }
946
+
947
+ /**
948
+ * @alpha
949
+ */
950
+ export declare interface IGCMetadata {
951
+ /**
952
+ * The version of the GC code that was run to generate the GC data that is written in the summary.
953
+ * If the persisted value doesn't match the current value in the code, saved GC data will be discarded and regenerated from scratch.
954
+ * Also, used to determine whether GC is enabled for this container or not:
955
+ * - A value of 0 or undefined means GC is disabled.
956
+ * - A value greater than 0 means GC is enabled.
957
+ */
958
+ readonly gcFeature?: GCVersion;
959
+ /**
960
+ * A collection of different numerical "Generations" for different features,
961
+ * used to determine feature availability over time.
962
+ * This info may come from multiple sources (FF code, config service, app via Container Runtime Options),
963
+ * and pertains to aspects of the document that may be fixed for its lifetime.
964
+ *
965
+ * For each dimension, if the persisted value doesn't match the currently provided value,
966
+ * then this file does not support the corresponding feature as currently implemented.
967
+ *
968
+ * Guidance is that if no value is provided at runtime, it should result in the current default behavior.
969
+ */
970
+ readonly gcFeatureMatrix?: GCFeatureMatrix;
971
+ /**
972
+ * Tells whether the GC sweep phase is enabled for this container.
973
+ * - True means sweep phase is enabled.
974
+ * - False means sweep phase is disabled. If GC is disabled as per gcFeature, sweep is also disabled.
975
+ *
976
+ * @deprecated use GCFeatureMatrix.gcGeneration instead. @see GCFeatureMatrix.gcGeneration
977
+ */
978
+ readonly sweepEnabled?: boolean;
979
+ /** If this is present, the session for this container will expire after this time and the container will close */
980
+ readonly sessionExpiryTimeoutMs?: number;
981
+ /** How long to wait after an object is unreferenced before deleting it via GC Sweep */
982
+ readonly sweepTimeoutMs?: number;
983
+ }
984
+
985
+ /**
986
+ * @alpha
987
+ */
988
+ export declare interface IGCRuntimeOptions {
989
+ /**
990
+ * Flag that if true, will enable running garbage collection (GC) for a new container.
991
+ *
992
+ * GC has mark phase and sweep phase. In mark phase, unreferenced objects are identified
993
+ * and marked as such in the summary. This option enables the mark phase.
994
+ * In sweep phase, unreferenced objects are eventually deleted from the container if they meet certain conditions.
995
+ * Sweep phase can be enabled using the "enableGCSweep" option.
996
+ *
997
+ * Note: This setting is persisted in the container's summary and cannot be changed.
998
+ */
999
+ gcAllowed?: boolean;
1000
+ /**
1001
+ * Flag that if true, will disable garbage collection for the session.
1002
+ * Can be used to disable running GC on containers where it is allowed via the gcAllowed option.
1003
+ */
1004
+ disableGC?: boolean;
1005
+ /**
1006
+ * Flag that if true, will enable the full Sweep Phase of garbage collection for this session,
1007
+ * where Tombstoned objects are permanently deleted from the container.
1008
+ *
1009
+ * IMPORTANT: This only applies if this document is allowed to run Sweep Phase.
1010
+ *
1011
+ * Current default behavior is for Sweep Phase not to delete Tombstoned objects,
1012
+ * but merely to prevent them from being loaded.
1013
+ */
1014
+ enableGCSweep?: true;
1015
+ /**
1016
+ * Flag that will bypass optimizations and generate GC data for all nodes irrespective of whether a node
1017
+ * changed or not.
1018
+ */
1019
+ runFullGC?: boolean;
1020
+ /**
1021
+ * Maximum session duration for a new container. If not present, a default value will be used.
1022
+ *
1023
+ * Note: This setting is persisted in the container's summary and cannot be changed.
1024
+ */
1025
+ sessionExpiryTimeoutMs?: number;
1026
+ /**
1027
+ * Delay between when Tombstone should run and when the object should be deleted.
1028
+ * This grace period gives a chance to intervene to recover if needed, before Sweep deletes the object.
1029
+ * If not present, a default (non-zero) value will be used.
1030
+ */
1031
+ sweepGracePeriodMs?: number;
1032
+ /**
1033
+ * Allows additional GC options to be passed.
1034
+ */
1035
+ [key: string]: any;
1036
+ }
1037
+
1038
+ /**
1039
+ * The statistics of the system state after a garbage collection run.
1040
+ * @alpha
1041
+ */
1042
+ export declare interface IGCStats extends IMarkPhaseStats, ISweepPhaseStats {
1043
+ }
1044
+
1045
+ /**
1046
+ * In addition to the normal summary tree + stats, this contains additional stats
1047
+ * only relevant at the root of the tree.
1048
+ * @alpha
1049
+ */
1050
+ export declare interface IGeneratedSummaryStats extends ISummaryStats {
1051
+ /** The total number of data stores in the container. */
1052
+ readonly dataStoreCount: number;
1053
+ /** The number of data stores that were summarized in this summary. */
1054
+ readonly summarizedDataStoreCount: number;
1055
+ /** The number of data stores whose GC reference state was updated in this summary. */
1056
+ readonly gcStateUpdatedDataStoreCount?: number;
1057
+ /** The size of the gc blobs in this summary. */
1058
+ readonly gcTotalBlobsSize?: number;
1059
+ /** The number of gc blobs in this summary. */
1060
+ readonly gcBlobNodeCount?: number;
1061
+ /** The summary number for a container's summary. Incremented on summaries throughout its lifetime. */
1062
+ readonly summaryNumber: number;
1063
+ }
1064
+
1065
+ /**
1066
+ * Results of submitSummary after generating the summary tree.
1067
+ * @alpha
1068
+ */
1069
+ export declare interface IGenerateSummaryTreeResult extends Omit<IBaseSummarizeResult, "stage"> {
1070
+ readonly stage: "generate";
1071
+ /** Generated summary tree. */
1072
+ readonly summaryTree: ISummaryTree;
1073
+ /** Stats for generated summary tree. */
1074
+ readonly summaryStats: IGeneratedSummaryStats;
1075
+ /** Time it took to generate the summary tree and stats. */
1076
+ readonly generateDuration: number;
1077
+ /** True if the full tree regeneration with no handle reuse optimizations was forced. */
1078
+ readonly forcedFullTree: boolean;
1079
+ }
1080
+
1081
+ /**
1082
+ * The statistics of the system state after a garbage collection mark phase run.
1083
+ * @alpha
1084
+ */
1085
+ export declare interface IMarkPhaseStats {
1086
+ /** The number of nodes in the container. */
1087
+ nodeCount: number;
1088
+ /** The number of data stores in the container. */
1089
+ dataStoreCount: number;
1090
+ /** The number of attachment blobs in the container. */
1091
+ attachmentBlobCount: number;
1092
+ /** The number of unreferenced nodes in the container. */
1093
+ unrefNodeCount: number;
1094
+ /** The number of unreferenced data stores in the container. */
1095
+ unrefDataStoreCount: number;
1096
+ /** The number of unreferenced attachment blobs in the container. */
1097
+ unrefAttachmentBlobCount: number;
1098
+ /** The number of nodes whose reference state updated since last GC run. */
1099
+ updatedNodeCount: number;
1100
+ /** The number of data stores whose reference state updated since last GC run. */
1101
+ updatedDataStoreCount: number;
1102
+ /** The number of attachment blobs whose reference state updated since last GC run. */
1103
+ updatedAttachmentBlobCount: number;
1104
+ }
1105
+
1106
+ /**
1107
+ * @alpha
1108
+ */
1109
+ export declare interface INackSummaryResult extends IRetriableFailureResult {
1110
+ readonly summaryNackOp: ISummaryNackMessage;
1111
+ readonly ackNackDuration: number;
1112
+ }
1113
+
1114
+ /**
1115
+ * Inactive error responses will have this header set to true
1116
+ * @internal
1117
+ */
1118
+ export declare const InactiveResponseHeaderKey = "isInactive";
1119
+
1120
+ /**
1121
+ * @alpha
1122
+ */
1123
+ export declare interface IOnDemandSummarizeOptions extends ISummarizeOptions {
1124
+ /** Reason for generating summary. */
1125
+ readonly reason: string;
1126
+ }
1127
+
1128
+ /**
1129
+ * Data required to update internal tracking state after receiving a Summary Ack.
1130
+ * @alpha
1131
+ */
1132
+ export declare interface IRefreshSummaryAckOptions {
1133
+ /** Handle from the ack's summary op. */
1134
+ readonly proposalHandle: string | undefined;
1135
+ /** Handle from the summary ack just received */
1136
+ readonly ackHandle: string;
1137
+ /** Reference sequence number from the ack's summary op */
1138
+ readonly summaryRefSeq: number;
1139
+ /** Telemetry logger to which telemetry events will be forwarded. */
1140
+ readonly summaryLogger: ITelemetryLoggerExt;
1141
+ }
1142
+
1143
+ /**
1144
+ * Type for summarization failures that are retriable.
1145
+ * @alpha
1146
+ */
1147
+ export declare interface IRetriableFailureResult {
1148
+ readonly retryAfterSeconds?: number;
1149
+ }
1150
+
1151
+ /**
1152
+ * Serialized state of IOrderedClientElection.
1153
+ * @alpha
1154
+ */
1155
+ export declare interface ISerializedElection {
1156
+ /** Sequence number at the time of the latest election. */
1157
+ readonly electionSequenceNumber: number;
1158
+ /**
1159
+ * Most recently elected client id. This is either:
1160
+ *
1161
+ * 1. the interactive elected parent client, in which case electedClientId === electedParentId,
1162
+ * and the SummaryManager on the elected client will spawn a summarizer client, or
1163
+ *
1164
+ * 2. the non-interactive summarizer client itself.
1165
+ */
1166
+ readonly electedClientId: string | undefined;
1167
+ /** Most recently elected parent client id. This is always an interactive client. */
1168
+ readonly electedParentId: string | undefined;
1169
+ }
1170
+
1171
+ /**
1172
+ * @deprecated please use version in driver-utils
1173
+ * @internal
1174
+ */
1175
+ export declare function isRuntimeMessage(message: ISequencedDocumentMessage): boolean;
1176
+
1177
+ export { isStableId }
1178
+
1179
+ /**
1180
+ * Results of submitSummary after submitting the summarize op.
1181
+ * @alpha
1182
+ */
1183
+ export declare interface ISubmitSummaryOpResult extends Omit<IUploadSummaryResult, "stage" | "error"> {
1184
+ readonly stage: "submit";
1185
+ /** The client sequence number of the summarize op submitted for the summary. */
1186
+ readonly clientSequenceNumber: number;
1187
+ /** Time it took to submit the summarize op to the broadcasting service. */
1188
+ readonly submitOpDuration: number;
1189
+ }
1190
+
1191
+ /**
1192
+ * @alpha
1193
+ */
1194
+ export declare interface ISubmitSummaryOptions extends ISummarizeOptions {
1195
+ /** Logger to use for correlated summary events */
1196
+ readonly summaryLogger: ITelemetryLoggerExt;
1197
+ /** Tells when summary process should be cancelled */
1198
+ readonly cancellationToken: ISummaryCancellationToken;
1199
+ /** Summarization may be attempted multiple times. This tells whether this is the final summarization attempt. */
1200
+ readonly finalAttempt?: boolean;
1201
+ }
1202
+
1203
+ /**
1204
+ * @alpha
1205
+ */
1206
+ export declare interface ISummarizeEventProps {
1207
+ result: "success" | "failure" | "canceled";
1208
+ currentAttempt: number;
1209
+ maxAttempts: number;
1210
+ error?: any;
1211
+ }
1212
+
1213
+ /**
1214
+ * Options affecting summarize behavior.
1215
+ * @alpha
1216
+ */
1217
+ export declare interface ISummarizeOptions {
1218
+ /** True to generate the full tree with no handle reuse optimizations; defaults to false */
1219
+ readonly fullTree?: boolean;
1220
+ /**
1221
+ * True to ask the server what the latest summary is first; defaults to false
1222
+ *
1223
+ * @deprecated Summarize will not refresh latest snapshot state anymore. Instead it updates the cache and closes.
1224
+ * It's expected a new summarizer client will be created, likely by the same parent.
1225
+ */
1226
+ readonly refreshLatestAck?: boolean;
1227
+ }
1228
+
1229
+ /**
1230
+ * @internal
1231
+ */
1232
+ export declare interface ISummarizer extends IEventProvider<ISummarizerEvents> {
1233
+ /**
1234
+ * Allows {@link ISummarizer} to be used with our {@link @fluidframework/core-interfaces#FluidObject} pattern.
1235
+ */
1236
+ readonly ISummarizer?: ISummarizer;
1237
+ stop(reason: SummarizerStopReason): void;
1238
+ close(): void;
1239
+ run(onBehalfOf: string, disableHeuristics?: boolean): Promise<SummarizerStopReason>;
1240
+ /**
1241
+ * Attempts to generate a summary on demand. If already running, takes no action.
1242
+ * @param options - options controlling the summarize attempt
1243
+ * @returns an alreadyRunning promise if a summarize attempt is already in progress,
1244
+ * which will resolve when the current attempt completes. At that point caller can
1245
+ * decide to try again or not. Otherwise, it will return an object containing promises
1246
+ * that resolve as the summarize attempt progresses. They will resolve with success
1247
+ * false if a failure is encountered.
1248
+ */
1249
+ summarizeOnDemand(options: IOnDemandSummarizeOptions): ISummarizeResults;
1250
+ /**
1251
+ * Enqueue an attempt to summarize after the specified sequence number.
1252
+ * If afterSequenceNumber is provided, the summarize attempt is "enqueued"
1253
+ * to run once an eligible op comes in with sequenceNumber \>= afterSequenceNumber.
1254
+ * @param options - options controlling the summarize attempt
1255
+ * @returns an object containing an alreadyEnqueued flag to indicate if another
1256
+ * summarize attempt has already been enqueued. It also may contain an overridden flag
1257
+ * when alreadyEnqueued is true, that indicates whether this attempt forced the
1258
+ * previous attempt to abort. If this attempt becomes enqueued, it returns an object
1259
+ * containing promises that resolve as the summarize attempt progresses. They will
1260
+ * resolve with success false if a failure is encountered.
1261
+ */
1262
+ enqueueSummarize(options: IEnqueueSummarizeOptions): EnqueueSummarizeResult;
1263
+ }
1264
+
1265
+ /**
1266
+ * @alpha
1267
+ */
1268
+ export declare interface ISummarizeResults {
1269
+ /** Resolves when we generate, upload, and submit the summary. */
1270
+ readonly summarySubmitted: Promise<SummarizeResultPart<SubmitSummaryResult, SubmitSummaryFailureData>>;
1271
+ /** Resolves when we observe our summarize op broadcast. */
1272
+ readonly summaryOpBroadcasted: Promise<SummarizeResultPart<IBroadcastSummaryResult>>;
1273
+ /** Resolves when we receive a summaryAck or summaryNack. */
1274
+ readonly receivedSummaryAckOrNack: Promise<SummarizeResultPart<IAckSummaryResult, INackSummaryResult>>;
1275
+ }
1276
+
1277
+ /**
1278
+ * @alpha
1279
+ */
1280
+ export declare interface ISummarizerEvents extends IEvent {
1281
+ (event: "summarize", listener: (props: ISummarizeEventProps) => void): any;
1282
+ }
1283
+
1284
+ /**
1285
+ * @alpha
1286
+ */
1287
+ export declare interface ISummarizerInternalsProvider {
1288
+ /** Encapsulates the work to walk the internals of the running container to generate a summary */
1289
+ submitSummary(options: ISubmitSummaryOptions): Promise<SubmitSummaryResult>;
1290
+ /** Callback whenever a new SummaryAck is received, to update internal tracking state */
1291
+ refreshLatestSummaryAck(options: IRefreshSummaryAckOptions): Promise<void>;
1292
+ }
1293
+
1294
+ /**
1295
+ * @alpha
1296
+ */
1297
+ export declare interface ISummarizerRuntime extends IConnectableRuntime {
1298
+ readonly logger: ITelemetryLoggerExt;
1299
+ /** clientId of parent (non-summarizing) container that owns summarizer container */
1300
+ readonly summarizerClientId: string | undefined;
1301
+ readonly deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>;
1302
+ disposeFn(): void;
1303
+ closeFn(): void;
1304
+ on(event: "op", listener: (op: ISequencedDocumentMessage, runtimeMessage?: boolean) => void): this;
1305
+ off(event: "op", listener: (op: ISequencedDocumentMessage, runtimeMessage?: boolean) => void): this;
1306
+ }
1307
+
1308
+ /**
1309
+ * @internal
1310
+ */
1311
+ export declare interface ISummarizingWarning extends ContainerWarning {
1312
+ readonly errorType: "summarizingError";
1313
+ readonly logged: boolean;
1314
+ }
1315
+
1316
+ /**
1317
+ * A single summary which can be tracked as it goes through its life cycle.
1318
+ * The life cycle is: Local to Broadcast to Acked/Nacked.
1319
+ * @internal
1320
+ */
1321
+ export declare interface ISummary {
1322
+ readonly clientId: string;
1323
+ readonly clientSequenceNumber: number;
1324
+ waitBroadcast(): Promise<ISummaryOpMessage>;
1325
+ waitAckNack(): Promise<ISummaryAckMessage | ISummaryNackMessage>;
1326
+ }
1327
+
1328
+ /**
1329
+ * Interface for summary ack messages with typed contents.
1330
+ * @alpha
1331
+ */
1332
+ export declare interface ISummaryAckMessage extends ISequencedDocumentMessage {
1333
+ type: MessageType.SummaryAck;
1334
+ contents: ISummaryAck;
1335
+ }
1336
+
1337
+ /**
1338
+ * @alpha
1339
+ */
1340
+ export declare interface ISummaryBaseConfiguration {
1341
+ /**
1342
+ * Delay before first attempt to spawn summarizing container.
1343
+ */
1344
+ initialSummarizerDelayMs: number;
1345
+ /**
1346
+ * Defines the maximum allowed time to wait for a pending summary ack.
1347
+ * The maximum amount of time client will wait for a summarize is the minimum of
1348
+ * maxSummarizeAckWaitTime (currently 3 * 60 * 1000) and maxAckWaitTime.
1349
+ */
1350
+ maxAckWaitTime: number;
1351
+ /**
1352
+ * Defines the maximum number of Ops in between Summaries that can be
1353
+ * allowed before forcibly electing a new summarizer client.
1354
+ */
1355
+ maxOpsSinceLastSummary: number;
1356
+ }
1357
+
1358
+ /**
1359
+ * Similar to AbortSignal, but using promise instead of events
1360
+ * @alpha
1361
+ */
1362
+ export declare type ISummaryCancellationToken = ICancellationToken<SummarizerStopReason>;
1363
+
1364
+ /**
1365
+ * @internal
1366
+ */
1367
+ export declare interface ISummaryCollectionOpEvents extends IEvent {
1368
+ (event: OpActionEventName, listener: OpActionEventListener): any;
1369
+ }
1370
+
1371
+ /**
1372
+ * @alpha
1373
+ */
1374
+ export declare type ISummaryConfiguration = ISummaryConfigurationDisableSummarizer | ISummaryConfigurationDisableHeuristics | ISummaryConfigurationHeuristics;
1375
+
1376
+ /**
1377
+ * @alpha
1378
+ */
1379
+ export declare interface ISummaryConfigurationDisableHeuristics extends ISummaryBaseConfiguration {
1380
+ state: "disableHeuristics";
1381
+ }
1382
+
1383
+ /**
1384
+ * @alpha
1385
+ */
1386
+ export declare interface ISummaryConfigurationDisableSummarizer {
1387
+ state: "disabled";
1388
+ }
1389
+
1390
+ /**
1391
+ * @alpha
1392
+ */
1393
+ export declare interface ISummaryConfigurationHeuristics extends ISummaryBaseConfiguration {
1394
+ state: "enabled";
1395
+ /**
1396
+ * Defines the maximum allowed time, since the last received Ack, before running the summary
1397
+ * with reason maxTime.
1398
+ * For example, say we receive ops one by one just before the idle time is triggered.
1399
+ * In this case, we still want to run a summary since it's been a while since the last summary.
1400
+ */
1401
+ maxTime: number;
1402
+ /**
1403
+ * Defines the maximum number of Ops, since the last received Ack, that can be allowed
1404
+ * before running the summary with reason maxOps.
1405
+ */
1406
+ maxOps: number;
1407
+ /**
1408
+ * Defines the minimum number of Ops, since the last received Ack, that can be allowed
1409
+ * before running the last summary.
1410
+ */
1411
+ minOpsForLastSummaryAttempt: number;
1412
+ /**
1413
+ * Defines the lower boundary for the allowed time in between summarizations.
1414
+ * Pairs with maxIdleTime to form a range.
1415
+ * For example, if we only receive 1 op, we don't want to have the same idle time as say 100 ops.
1416
+ * Based on the boundaries we set in minIdleTime and maxIdleTime, the idle time will change
1417
+ * linearly depending on the number of ops we receive.
1418
+ */
1419
+ minIdleTime: number;
1420
+ /**
1421
+ * Defines the upper boundary for the allowed time in between summarizations.
1422
+ * Pairs with minIdleTime to form a range.
1423
+ * For example, if we only receive 1 op, we don't want to have the same idle time as say 100 ops.
1424
+ * Based on the boundaries we set in minIdleTime and maxIdleTime, the idle time will change
1425
+ * linearly depending on the number of ops we receive.
1426
+ */
1427
+ maxIdleTime: number;
1428
+ /**
1429
+ * Runtime op weight to use in heuristic summarizing.
1430
+ * This number is a multiplier on the number of runtime ops we process when running summarize heuristics.
1431
+ * For example: (multiplier) * (number of runtime ops) = weighted number of runtime ops
1432
+ */
1433
+ runtimeOpWeight: number;
1434
+ /**
1435
+ * Non-runtime op weight to use in heuristic summarizing
1436
+ * This number is a multiplier on the number of non-runtime ops we process when running summarize heuristics.
1437
+ * For example: (multiplier) * (number of non-runtime ops) = weighted number of non-runtime ops
1438
+ */
1439
+ nonRuntimeOpWeight: number;
1440
+ /**
1441
+ * Number of ops since last summary needed before a non-runtime op can trigger running summary heuristics.
1442
+ *
1443
+ * Note: Any runtime ops sent before the threshold is reached will trigger heuristics normally.
1444
+ * This threshold ONLY applies to non-runtime ops triggering summaries.
1445
+ *
1446
+ * For example: Say the threshold is 20. Sending 19 non-runtime ops will not trigger any heuristic checks.
1447
+ * Sending the 20th non-runtime op will trigger the heuristic checks for summarizing.
1448
+ */
1449
+ nonRuntimeHeuristicThreshold?: number;
1450
+ }
1451
+
1452
+ /**
1453
+ * The properties of an ISequencedDocumentMessage to be stored in the metadata blob in summary.
1454
+ * @alpha
1455
+ */
1456
+ export declare type ISummaryMetadataMessage = Pick<ISequencedDocumentMessage, "clientId" | "clientSequenceNumber" | "minimumSequenceNumber" | "referenceSequenceNumber" | "sequenceNumber" | "timestamp" | "type">;
1457
+
1458
+ /**
1459
+ * Interface for summary nack messages with typed contents.
1460
+ * @alpha
1461
+ */
1462
+ export declare interface ISummaryNackMessage extends ISequencedDocumentMessage {
1463
+ type: MessageType.SummaryNack;
1464
+ contents: ISummaryNack;
1465
+ }
1466
+
1467
+ /**
1468
+ * Interface for summary op messages with typed contents.
1469
+ * @alpha
1470
+ */
1471
+ export declare interface ISummaryOpMessage extends ISequencedDocumentMessage {
1472
+ type: MessageType.Summarize;
1473
+ contents: ISummaryContent;
1474
+ }
1475
+
1476
+ /**
1477
+ * @alpha
1478
+ */
1479
+ export declare interface ISummaryRuntimeOptions {
1480
+ /** Override summary configurations set by the server. */
1481
+ summaryConfigOverrides?: ISummaryConfiguration;
1482
+ /**
1483
+ * Delay before first attempt to spawn summarizing container.
1484
+ *
1485
+ * @deprecated Use {@link ISummaryRuntimeOptions.summaryConfigOverrides}'s
1486
+ * {@link ISummaryBaseConfiguration.initialSummarizerDelayMs} instead.
1487
+ */
1488
+ initialSummarizerDelayMs?: number;
1489
+ }
1490
+
1491
+ /**
1492
+ * The statistics of the system state after a garbage collection sweep phase run.
1493
+ * @alpha
1494
+ */
1495
+ export declare interface ISweepPhaseStats {
1496
+ /** The number of nodes in the lifetime of the container. */
1497
+ lifetimeNodeCount: number;
1498
+ /** The number of data stores in the lifetime of the container. */
1499
+ lifetimeDataStoreCount: number;
1500
+ /** The number of attachment blobs in the lifetime of the container. */
1501
+ lifetimeAttachmentBlobCount: number;
1502
+ /** The number of deleted nodes in the container. */
1503
+ deletedNodeCount: number;
1504
+ /** The number of deleted data stores in the container. */
1505
+ deletedDataStoreCount: number;
1506
+ /** The number of deleted attachment blobs in the container. */
1507
+ deletedAttachmentBlobCount: number;
1508
+ }
1509
+
1510
+ /**
1511
+ * Results of submitSummary after uploading the tree to storage.
1512
+ * @alpha
1513
+ */
1514
+ export declare interface IUploadSummaryResult extends Omit<IGenerateSummaryTreeResult, "stage"> {
1515
+ readonly stage: "upload";
1516
+ /** The handle returned by storage pointing to the uploaded summary tree. */
1517
+ readonly handle: string;
1518
+ /** Time it took to upload the summary tree to storage. */
1519
+ readonly uploadDuration: number;
1520
+ }
1521
+
1522
+ /**
1523
+ * Can be useful in testing as well as in places where caller does not use cancellation.
1524
+ * This object implements ISummaryCancellationToken interface but cancellation is never leveraged.
1525
+ * @internal
1526
+ */
1527
+ export declare const neverCancelledSummaryToken: ISummaryCancellationToken;
1528
+
1529
+ /**
1530
+ * @internal
1531
+ */
1532
+ export declare type OpActionEventListener = (op: ISequencedDocumentMessage) => void;
1533
+
1534
+ /**
1535
+ * @internal
1536
+ */
1537
+ export declare type OpActionEventName = MessageType.Summarize | MessageType.SummaryAck | MessageType.SummaryNack | "default";
1538
+
1539
+ /**
1540
+ * Additional details expected for any recently added message.
1541
+ * @internal
1542
+ */
1543
+ export declare interface RecentlyAddedContainerRuntimeMessageDetails {
1544
+ /** Info describing how to handle this op in case the type is unrecognized (default: fail to process) */
1545
+ compatDetails: IContainerRuntimeMessageCompatDetails;
1546
+ }
1547
+
1548
+ /**
1549
+ * Accepted header keys for requests coming to the runtime.
1550
+ * @internal
1551
+ */
1552
+ export declare enum RuntimeHeaders {
1553
+ /** True to wait for a data store to be created and loaded before returning it. */
1554
+ wait = "wait",
1555
+ /** True if the request is coming from an IFluidHandle. */
1556
+ viaHandle = "viaHandle"
1557
+ }
1558
+
1559
+ /**
1560
+ * @deprecated use ContainerRuntimeMessageType instead
1561
+ * @internal
1562
+ */
1563
+ export declare enum RuntimeMessage {
1564
+ FluidDataStoreOp = "component",
1565
+ Attach = "attach",
1566
+ ChunkedOp = "chunkedOp",
1567
+ BlobAttach = "blobAttach",
1568
+ Rejoin = "rejoin",
1569
+ Alias = "alias",
1570
+ Operation = "op"
1571
+ }
1572
+
1573
+ /**
1574
+ * The data in summarizer result when submit summary stage fails.
1575
+ * @alpha
1576
+ */
1577
+ export declare interface SubmitSummaryFailureData extends IRetriableFailureResult {
1578
+ stage: SummaryStage;
1579
+ }
1580
+
1581
+ /**
1582
+ * Strict type representing result of a submitSummary attempt.
1583
+ * The result consists of 4 possible stages, each with its own data.
1584
+ * The data is cumulative, so each stage will contain the data from the previous stages.
1585
+ * If the final "submitted" stage is not reached, the result may contain the error object.
1586
+ *
1587
+ * Stages:
1588
+ *
1589
+ * 1. "base" - stopped before the summary tree was even generated, and the result only contains the base data
1590
+ *
1591
+ * 2. "generate" - the summary tree was generated, and the result will contain that tree + stats
1592
+ *
1593
+ * 3. "upload" - the summary was uploaded to storage, and the result contains the server-provided handle
1594
+ *
1595
+ * 4. "submit" - the summarize op was submitted, and the result contains the op client sequence number.
1596
+ * @alpha
1597
+ */
1598
+ export declare type SubmitSummaryResult = IBaseSummarizeResult | IGenerateSummaryTreeResult | IUploadSummaryResult | ISubmitSummaryOpResult;
1599
+
1600
+ /**
1601
+ * Summarizer is responsible for coordinating when to generate and send summaries.
1602
+ * It is the main entry point for summary work.
1603
+ * It is created only by summarizing container (i.e. one with clientType === "summarizer")
1604
+ * @internal
1605
+ */
1606
+ export declare class Summarizer extends TypedEventEmitter<ISummarizerEvents> implements ISummarizer {
1607
+ /** Reference to runtime that created this object.
1608
+ * i.e. runtime with clientType === "summarizer"
1609
+ */
1610
+ private readonly runtime;
1611
+ private readonly configurationGetter;
1612
+ /** Represents an object that can generate summary.
1613
+ * In practical terms, it's same runtime (this.runtime) with clientType === "summarizer".
1614
+ */
1615
+ private readonly internalsProvider;
1616
+ readonly summaryCollection: SummaryCollection;
1617
+ private readonly runCoordinatorCreateFn;
1618
+ get ISummarizer(): this;
1619
+ private readonly logger;
1620
+ private runningSummarizer?;
1621
+ private _disposed;
1622
+ private starting;
1623
+ private readonly stopDeferred;
1624
+ constructor(
1625
+ /** Reference to runtime that created this object.
1626
+ * i.e. runtime with clientType === "summarizer"
1627
+ */
1628
+ runtime: ISummarizerRuntime, configurationGetter: () => ISummaryConfiguration,
1629
+ /** Represents an object that can generate summary.
1630
+ * In practical terms, it's same runtime (this.runtime) with clientType === "summarizer".
1631
+ */
1632
+ internalsProvider: ISummarizerInternalsProvider, handleContext: IFluidHandleContext, summaryCollection: SummaryCollection, runCoordinatorCreateFn: (runtime: IConnectableRuntime) => Promise<ICancellableSummarizerController>);
1633
+ run(onBehalfOf: string): Promise<SummarizerStopReason>;
1634
+ /**
1635
+ * Stops the summarizer from running. This will complete
1636
+ * the run promise, and also close the container.
1637
+ * @param reason - reason code for stopping
1638
+ */
1639
+ stop(reason: SummarizerStopReason): void;
1640
+ close(): void;
1641
+ private runCore;
1642
+ /**
1643
+ * Should we try to run a last summary for the given stop reason?
1644
+ * Currently only allows "parentNotConnected"
1645
+ * @param stopReason - SummarizerStopReason
1646
+ * @returns `true` if the stop reason can run a last summary, otherwise `false`.
1647
+ */
1648
+ static stopReasonCanRunLastSummary(stopReason: SummarizerStopReason): boolean;
1649
+ private _heuristicData;
1650
+ /**
1651
+ * Put the summarizer in a started state, including creating and initializing the RunningSummarizer.
1652
+ * The start request can come either from the SummaryManager (in the auto-summarize case) or from the user
1653
+ * (in the on-demand case).
1654
+ * @param onBehalfOf - ID of the client that requested that the summarizer start
1655
+ * @param runCoordinator - cancellation token
1656
+ * @param newConfig - Summary configuration to override the existing config when invoking the RunningSummarizer.
1657
+ * @returns A promise that is fulfilled when the RunningSummarizer is ready.
1658
+ */
1659
+ private start;
1660
+ private readonly handleSummarizeEvent;
1661
+ /**
1662
+ * Disposes of resources after running. This cleanup will
1663
+ * clear any outstanding timers and reset some of the state
1664
+ * properties.
1665
+ * Called by ContainerRuntime when it is disposed, as well as at the end the run().
1666
+ */
1667
+ dispose(): void;
1668
+ summarizeOnDemand(options: IOnDemandSummarizeOptions): ISummarizeResults;
1669
+ enqueueSummarize(options: IEnqueueSummarizeOptions): EnqueueSummarizeResult;
1670
+ recordSummaryAttempt?(summaryRefSeqNum?: number): void;
1671
+ }
1672
+
1673
+ /**
1674
+ * @alpha
1675
+ */
1676
+ export declare type SummarizeResultPart<TSuccess, TFailure = undefined> = {
1677
+ success: true;
1678
+ data: TSuccess;
1679
+ } | {
1680
+ success: false;
1681
+ data: TFailure | undefined;
1682
+ message: string;
1683
+ error: any;
1684
+ };
1685
+
1686
+ /**
1687
+ * @alpha
1688
+ */
1689
+ export declare type SummarizerStopReason =
1690
+ /** Summarizer client failed to summarize in all 3 consecutive attempts. */
1691
+ "failToSummarize"
1692
+ /** Parent client reported that it is no longer connected. */
1693
+ | "parentNotConnected"
1694
+ /**
1695
+ * Parent client reported that it is no longer elected the summarizer.
1696
+ * This is the normal flow; a disconnect will always trigger the parent
1697
+ * client to no longer be elected as responsible for summaries. Then it
1698
+ * tries to stop its spawned summarizer client.
1699
+ */
1700
+ | "notElectedParent"
1701
+ /**
1702
+ * We are not already running the summarizer and we are not the current elected client id.
1703
+ */
1704
+ | "notElectedClient"
1705
+ /** Summarizer client was disconnected */
1706
+ | "summarizerClientDisconnected"
1707
+ /** running summarizer threw an exception */
1708
+ | "summarizerException"
1709
+ /**
1710
+ * The previous summary state on the summarizer is not the most recently acked summary. this also happens when the
1711
+ * first submitSummary attempt fails for any reason and there's a 2nd summary attempt without an ack
1712
+ */
1713
+ | "latestSummaryStateStale";
1714
+
1715
+ /**
1716
+ * Data structure that looks at the op stream to track summaries as they
1717
+ * are broadcast, acked and nacked.
1718
+ * It provides functionality for watching specific summaries.
1719
+ * @internal
1720
+ */
1721
+ export declare class SummaryCollection extends TypedEventEmitter<ISummaryCollectionOpEvents> {
1722
+ private readonly deltaManager;
1723
+ private readonly logger;
1724
+ private readonly summaryWatchers;
1725
+ private readonly pendingSummaries;
1726
+ private refreshWaitNextAck;
1727
+ private lastSummaryTimestamp;
1728
+ private maxAckWaitTime;
1729
+ private pendingAckTimerTimeoutCallback;
1730
+ private lastAck;
1731
+ get latestAck(): IAckedSummary | undefined;
1732
+ emit(event: OpActionEventName, ...args: Parameters<OpActionEventListener>): boolean;
1733
+ get opsSinceLastAck(): number;
1734
+ addOpListener(listener: () => void): void;
1735
+ removeOpListener(listener: () => void): void;
1736
+ constructor(deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>, logger: ITelemetryLoggerExt);
1737
+ /**
1738
+ * Creates and returns a summary watcher for a specific client.
1739
+ * This will allow for local sent summaries to be better tracked.
1740
+ * @param clientId - client id for watcher
1741
+ */
1742
+ createWatcher(clientId: string): IClientSummaryWatcher;
1743
+ removeWatcher(clientId: string): void;
1744
+ setPendingAckTimerTimeoutCallback(maxAckWaitTime: number, timeoutCallback: () => void): void;
1745
+ unsetPendingAckTimerTimeoutCallback(): void;
1746
+ /**
1747
+ * Returns a promise that resolves once all pending summary ops
1748
+ * have been acked or nacked.
1749
+ */
1750
+ waitFlushed(): Promise<IAckedSummary | undefined>;
1751
+ /**
1752
+ * Returns a promise that resolves once a summary is acked that has a reference
1753
+ * sequence number greater than or equal to the passed in sequence number.
1754
+ * @param referenceSequenceNumber - reference sequence number to wait for
1755
+ * @returns The latest acked summary
1756
+ */
1757
+ waitSummaryAck(referenceSequenceNumber: number): Promise<IAckedSummary>;
1758
+ private parseContent;
1759
+ /**
1760
+ * Handler for ops; only handles ops relating to summaries.
1761
+ * @param op - op message to handle
1762
+ */
1763
+ private handleOp;
1764
+ private handleSummaryOp;
1765
+ private handleSummaryAck;
1766
+ private handleSummaryNack;
1767
+ }
1768
+
1769
+ /**
1770
+ * The stages of Summarize, used to describe how far progress succeeded in case of a failure at a later stage.
1771
+ * @alpha
1772
+ */
1773
+ export declare type SummaryStage = SubmitSummaryResult["stage"] | "unknown";
1774
+
1775
+ /**
1776
+ * Tombstone error responses will have this header set to true
1777
+ * @internal
1778
+ */
1779
+ export declare const TombstoneResponseHeaderKey = "isTombstoned";
1780
+
1781
+ /**
1782
+ * Unpacks runtime messages.
1783
+ *
1784
+ * @remarks This API makes no promises regarding backward-compatibility. This is internal API.
1785
+ * @param message - message (as it observed in storage / service)
1786
+ * @returns whether the given message was unpacked
1787
+ *
1788
+ * @internal
1789
+ */
1790
+ export declare function unpackRuntimeMessage(message: ISequencedDocumentMessage): boolean;
1791
+
1792
+ export { }