@fluidframework/container-runtime 2.0.0-internal.7.0.1 → 2.0.0-internal.7.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (106) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/api-extractor.json +13 -1
  3. package/api-report/container-runtime.api.md +800 -0
  4. package/dist/blobManager.js +1 -1
  5. package/dist/blobManager.js.map +1 -1
  6. package/dist/connectionTelemetry.d.ts.map +1 -1
  7. package/dist/connectionTelemetry.js +75 -42
  8. package/dist/connectionTelemetry.js.map +1 -1
  9. package/dist/container-runtime-alpha.d.ts +1554 -0
  10. package/dist/container-runtime-beta.d.ts +1554 -0
  11. package/dist/container-runtime-public.d.ts +1554 -0
  12. package/dist/container-runtime.d.ts +1611 -0
  13. package/dist/containerRuntime.d.ts +20 -14
  14. package/dist/containerRuntime.d.ts.map +1 -1
  15. package/dist/containerRuntime.js +53 -27
  16. package/dist/containerRuntime.js.map +1 -1
  17. package/dist/error.d.ts.map +1 -1
  18. package/dist/error.js.map +1 -1
  19. package/dist/gc/gcDefinitions.d.ts +2 -2
  20. package/dist/gc/gcDefinitions.d.ts.map +1 -1
  21. package/dist/gc/gcDefinitions.js.map +1 -1
  22. package/dist/index.d.ts +1 -1
  23. package/dist/index.d.ts.map +1 -1
  24. package/dist/index.js +2 -1
  25. package/dist/index.js.map +1 -1
  26. package/dist/opLifecycle/outbox.d.ts.map +1 -1
  27. package/dist/opLifecycle/outbox.js +7 -2
  28. package/dist/opLifecycle/outbox.js.map +1 -1
  29. package/dist/packageVersion.d.ts +1 -1
  30. package/dist/packageVersion.js +1 -1
  31. package/dist/packageVersion.js.map +1 -1
  32. package/dist/pendingStateManager.d.ts.map +1 -1
  33. package/dist/pendingStateManager.js +3 -1
  34. package/dist/pendingStateManager.js.map +1 -1
  35. package/dist/scheduleManager.js +6 -2
  36. package/dist/scheduleManager.js.map +1 -1
  37. package/dist/summary/summarizer.d.ts +1 -0
  38. package/dist/summary/summarizer.d.ts.map +1 -1
  39. package/dist/summary/summarizer.js +14 -7
  40. package/dist/summary/summarizer.js.map +1 -1
  41. package/dist/summary/summaryCollection.d.ts.map +1 -1
  42. package/dist/summary/summaryCollection.js +1 -0
  43. package/dist/summary/summaryCollection.js.map +1 -1
  44. package/dist/summary/summaryGenerator.js.map +1 -1
  45. package/dist/summary/summaryManager.d.ts +2 -2
  46. package/dist/summary/summaryManager.d.ts.map +1 -1
  47. package/dist/summary/summaryManager.js +3 -3
  48. package/dist/summary/summaryManager.js.map +1 -1
  49. package/dist/tsdoc-metadata.json +1 -1
  50. package/lib/blobManager.js +1 -1
  51. package/lib/blobManager.js.map +1 -1
  52. package/lib/connectionTelemetry.d.ts.map +1 -1
  53. package/lib/connectionTelemetry.js +76 -43
  54. package/lib/connectionTelemetry.js.map +1 -1
  55. package/lib/containerRuntime.d.ts +20 -14
  56. package/lib/containerRuntime.d.ts.map +1 -1
  57. package/lib/containerRuntime.js +52 -29
  58. package/lib/containerRuntime.js.map +1 -1
  59. package/lib/error.d.ts.map +1 -1
  60. package/lib/error.js.map +1 -1
  61. package/lib/gc/gcDefinitions.d.ts +2 -2
  62. package/lib/gc/gcDefinitions.d.ts.map +1 -1
  63. package/lib/gc/gcDefinitions.js.map +1 -1
  64. package/lib/index.d.ts +1 -1
  65. package/lib/index.d.ts.map +1 -1
  66. package/lib/index.js +1 -1
  67. package/lib/index.js.map +1 -1
  68. package/lib/opLifecycle/outbox.d.ts.map +1 -1
  69. package/lib/opLifecycle/outbox.js +7 -2
  70. package/lib/opLifecycle/outbox.js.map +1 -1
  71. package/lib/packageVersion.d.ts +1 -1
  72. package/lib/packageVersion.js +1 -1
  73. package/lib/packageVersion.js.map +1 -1
  74. package/lib/pendingStateManager.d.ts.map +1 -1
  75. package/lib/pendingStateManager.js +3 -1
  76. package/lib/pendingStateManager.js.map +1 -1
  77. package/lib/scheduleManager.js +6 -2
  78. package/lib/scheduleManager.js.map +1 -1
  79. package/lib/summary/summarizer.d.ts +1 -0
  80. package/lib/summary/summarizer.d.ts.map +1 -1
  81. package/lib/summary/summarizer.js +15 -8
  82. package/lib/summary/summarizer.js.map +1 -1
  83. package/lib/summary/summaryCollection.d.ts.map +1 -1
  84. package/lib/summary/summaryCollection.js +1 -0
  85. package/lib/summary/summaryCollection.js.map +1 -1
  86. package/lib/summary/summaryGenerator.js.map +1 -1
  87. package/lib/summary/summaryManager.d.ts +2 -2
  88. package/lib/summary/summaryManager.d.ts.map +1 -1
  89. package/lib/summary/summaryManager.js +3 -3
  90. package/lib/summary/summaryManager.js.map +1 -1
  91. package/package.json +25 -53
  92. package/src/blobManager.ts +1 -1
  93. package/src/connectionTelemetry.ts +97 -52
  94. package/src/containerRuntime.ts +70 -43
  95. package/src/error.ts +4 -1
  96. package/src/gc/gcDefinitions.ts +2 -2
  97. package/src/index.ts +1 -0
  98. package/src/opLifecycle/README.md +53 -28
  99. package/src/opLifecycle/outbox.ts +3 -0
  100. package/src/packageVersion.ts +1 -1
  101. package/src/pendingStateManager.ts +1 -0
  102. package/src/scheduleManager.ts +2 -0
  103. package/src/summary/summarizer.ts +20 -9
  104. package/src/summary/summaryCollection.ts +1 -0
  105. package/src/summary/summaryGenerator.ts +3 -3
  106. package/src/summary/summaryManager.ts +2 -2
@@ -0,0 +1,800 @@
1
+ ## API Report File for "@fluidframework/container-runtime"
2
+
3
+ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
4
+
5
+ ```ts
6
+
7
+ import { AttachState } from '@fluidframework/container-definitions';
8
+ import { ContainerWarning } from '@fluidframework/container-definitions';
9
+ import { FluidDataStoreRegistryEntry } from '@fluidframework/runtime-definitions';
10
+ import { FluidObject } from '@fluidframework/core-interfaces';
11
+ import { FlushMode } from '@fluidframework/runtime-definitions';
12
+ import { IAudience } from '@fluidframework/container-definitions';
13
+ import { IClientDetails } from '@fluidframework/protocol-definitions';
14
+ import { IContainerContext } from '@fluidframework/container-definitions';
15
+ import { IContainerRuntime } from '@fluidframework/container-runtime-definitions';
16
+ import { IContainerRuntimeEvents } from '@fluidframework/container-runtime-definitions';
17
+ import { ICriticalContainerError } from '@fluidframework/container-definitions';
18
+ import { IDataStore } from '@fluidframework/runtime-definitions';
19
+ import { IDeltaManager } from '@fluidframework/container-definitions';
20
+ import { IDisposable } from '@fluidframework/core-interfaces';
21
+ import { IDocumentMessage } from '@fluidframework/protocol-definitions';
22
+ import { IDocumentStorageService } from '@fluidframework/driver-definitions';
23
+ import { IEvent } from '@fluidframework/core-interfaces';
24
+ import { IEventProvider } from '@fluidframework/core-interfaces';
25
+ import { IFluidDataStoreContextDetached } from '@fluidframework/runtime-definitions';
26
+ import { IFluidDataStoreRegistry } from '@fluidframework/runtime-definitions';
27
+ import { IFluidHandle } from '@fluidframework/core-interfaces';
28
+ import { IFluidHandleContext } from '@fluidframework/core-interfaces';
29
+ import { IFluidRouter } from '@fluidframework/core-interfaces';
30
+ import { IGarbageCollectionData } from '@fluidframework/runtime-definitions';
31
+ import { IIdCompressor } from '@fluidframework/runtime-definitions';
32
+ import { IIdCompressorCore } from '@fluidframework/runtime-definitions';
33
+ import { ILoader } from '@fluidframework/container-definitions';
34
+ import { ILoaderOptions } from '@fluidframework/container-definitions';
35
+ import { IProvideFluidHandleContext } from '@fluidframework/core-interfaces';
36
+ import { IQuorumClients } from '@fluidframework/protocol-definitions';
37
+ import { IRequest } from '@fluidframework/core-interfaces';
38
+ import { IResponse } from '@fluidframework/core-interfaces';
39
+ import { IRuntime } from '@fluidframework/container-definitions';
40
+ import { ISequencedDocumentMessage } from '@fluidframework/protocol-definitions';
41
+ import { ISignalMessage } from '@fluidframework/protocol-definitions';
42
+ import { ISummaryAck } from '@fluidframework/protocol-definitions';
43
+ import { ISummaryContent } from '@fluidframework/protocol-definitions';
44
+ import { ISummaryNack } from '@fluidframework/protocol-definitions';
45
+ import { ISummaryStats } from '@fluidframework/runtime-definitions';
46
+ import { ISummaryTree } from '@fluidframework/protocol-definitions';
47
+ import { ISummaryTreeWithStats } from '@fluidframework/runtime-definitions';
48
+ import { ITelemetryContext } from '@fluidframework/runtime-definitions';
49
+ import { ITelemetryLoggerExt } from '@fluidframework/telemetry-utils';
50
+ import { MessageType } from '@fluidframework/protocol-definitions';
51
+ import { NamedFluidDataStoreRegistryEntries } from '@fluidframework/runtime-definitions';
52
+ import { StableId } from '@fluidframework/runtime-definitions';
53
+ import { TypedEventEmitter } from '@fluid-internal/client-utils';
54
+
55
+ // @public
56
+ export const agentSchedulerId = "_scheduler";
57
+
58
+ // @public
59
+ export const AllowInactiveRequestHeaderKey = "allowInactive";
60
+
61
+ // @public
62
+ export const AllowTombstoneRequestHeaderKey = "allowTombstone";
63
+
64
+ // @public
65
+ export function assertIsStableId(stableId: string): StableId;
66
+
67
+ // @internal
68
+ export type CompatModeBehavior =
69
+ /** Ignore the op. It won't be persisted if this client summarizes */
70
+ "Ignore"
71
+ /** Fail processing immediately. (The container will close) */
72
+ | "FailToProcess";
73
+
74
+ // @public
75
+ export enum CompressionAlgorithms {
76
+ // (undocumented)
77
+ lz4 = "lz4"
78
+ }
79
+
80
+ // @public (undocumented)
81
+ export enum ContainerMessageType {
82
+ // (undocumented)
83
+ Alias = "alias",
84
+ // (undocumented)
85
+ Attach = "attach",
86
+ // (undocumented)
87
+ BlobAttach = "blobAttach",
88
+ // (undocumented)
89
+ ChunkedOp = "chunkedOp",
90
+ // (undocumented)
91
+ FluidDataStoreOp = "component",
92
+ IdAllocation = "idAllocation",
93
+ // (undocumented)
94
+ Rejoin = "rejoin"
95
+ }
96
+
97
+ // @public
98
+ export class ContainerRuntime extends TypedEventEmitter<IContainerRuntimeEvents & ISummarizerEvents> implements IContainerRuntime, IRuntime, ISummarizerRuntime, ISummarizerInternalsProvider, IProvideFluidHandleContext {
99
+ // @internal
100
+ 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);
101
+ // (undocumented)
102
+ protected addContainerStateToSummary(summaryTree: ISummaryTreeWithStats, fullTree: boolean, trackState: boolean, telemetryContext?: ITelemetryContext): void;
103
+ addedGCOutboundReference(srcHandle: IFluidHandle, outboundHandle: IFluidHandle): void;
104
+ // (undocumented)
105
+ get attachState(): AttachState;
106
+ // (undocumented)
107
+ readonly clientDetails: IClientDetails;
108
+ // (undocumented)
109
+ get clientId(): string | undefined;
110
+ // (undocumented)
111
+ readonly closeFn: (error?: ICriticalContainerError) => void;
112
+ collectGarbage(options: {
113
+ logger?: ITelemetryLoggerExt;
114
+ runSweep?: boolean;
115
+ fullGC?: boolean;
116
+ }, telemetryContext?: ITelemetryContext): Promise<IGCStats | undefined>;
117
+ // (undocumented)
118
+ get connected(): boolean;
119
+ // (undocumented)
120
+ createDataStore(pkg: string | string[]): Promise<IDataStore>;
121
+ // @internal @deprecated (undocumented)
122
+ _createDataStoreWithProps(pkg: string | string[], props?: any, id?: string): Promise<IDataStore>;
123
+ // (undocumented)
124
+ createDetachedDataStore(pkg: Readonly<string[]>): IFluidDataStoreContextDetached;
125
+ // (undocumented)
126
+ createDetachedRootDataStore(pkg: Readonly<string[]>, rootDataStoreId: string): IFluidDataStoreContextDetached;
127
+ createSummary(blobRedirectTable?: Map<string, string>, telemetryContext?: ITelemetryContext): ISummaryTree;
128
+ deleteSweepReadyNodes(sweepReadyRoutes: string[]): string[];
129
+ // @deprecated (undocumented)
130
+ deleteUnusedNodes(unusedRoutes: string[]): string[];
131
+ readonly deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>;
132
+ // (undocumented)
133
+ dispose(error?: Error): void;
134
+ // (undocumented)
135
+ get disposed(): boolean;
136
+ // (undocumented)
137
+ readonly disposeFn: (error?: ICriticalContainerError) => void;
138
+ // (undocumented)
139
+ enqueueSummarize(options: IEnqueueSummarizeOptions): EnqueueSummarizeResult;
140
+ ensureNoDataModelChanges<T>(callback: () => T): T;
141
+ // (undocumented)
142
+ get flushMode(): FlushMode;
143
+ get gcThrowOnTombstoneUsage(): boolean;
144
+ get gcTombstoneEnforcementAllowed(): boolean;
145
+ // (undocumented)
146
+ readonly getAbsoluteUrl: (relativeUrl: string) => Promise<string | undefined>;
147
+ getAliasedDataStoreEntryPoint(alias: string): Promise<IFluidHandle<FluidObject> | undefined>;
148
+ // (undocumented)
149
+ getAudience(): IAudience;
150
+ getCurrentReferenceTimestampMs(): number | undefined;
151
+ // (undocumented)
152
+ getEntryPoint(): Promise<FluidObject>;
153
+ getGCData(fullGC?: boolean): Promise<IGarbageCollectionData>;
154
+ getGCNodePackagePath(nodePath: string): Promise<readonly string[] | undefined>;
155
+ getNodeType(nodePath: string): GCNodeType;
156
+ // (undocumented)
157
+ getPendingLocalState(props?: {
158
+ notifyImminentClosure: boolean;
159
+ }): Promise<unknown>;
160
+ // (undocumented)
161
+ getQuorum(): IQuorumClients;
162
+ // @deprecated
163
+ getRootDataStore(id: string, wait?: boolean): Promise<IFluidRouter>;
164
+ // (undocumented)
165
+ idCompressor: (IIdCompressor & IIdCompressorCore) | undefined;
166
+ // (undocumented)
167
+ get IFluidDataStoreRegistry(): IFluidDataStoreRegistry;
168
+ // (undocumented)
169
+ get IFluidHandleContext(): IFluidHandleContext;
170
+ // @deprecated (undocumented)
171
+ get IFluidRouter(): this;
172
+ get isDirty(): boolean;
173
+ // @deprecated (undocumented)
174
+ static load(context: IContainerContext, registryEntries: NamedFluidDataStoreRegistryEntries, requestHandler?: (request: IRequest, runtime: IContainerRuntime) => Promise<IResponse>, runtimeOptions?: IContainerRuntimeOptions, containerScope?: FluidObject, existing?: boolean, containerRuntimeCtor?: typeof ContainerRuntime): Promise<ContainerRuntime>;
175
+ static loadRuntime(params: {
176
+ context: IContainerContext;
177
+ registryEntries: NamedFluidDataStoreRegistryEntries;
178
+ existing: boolean;
179
+ runtimeOptions?: IContainerRuntimeOptions;
180
+ containerScope?: FluidObject;
181
+ containerRuntimeCtor?: typeof ContainerRuntime;
182
+ requestHandler?: (request: IRequest, runtime: IContainerRuntime) => Promise<IResponse>;
183
+ provideEntryPoint: (containerRuntime: IContainerRuntime) => Promise<FluidObject>;
184
+ }): Promise<ContainerRuntime>;
185
+ // (undocumented)
186
+ readonly logger: ITelemetryLoggerExt;
187
+ // (undocumented)
188
+ notifyAttaching(): void;
189
+ // (undocumented)
190
+ notifyOpReplay(message: ISequencedDocumentMessage): Promise<void>;
191
+ // (undocumented)
192
+ readonly options: ILoaderOptions;
193
+ // (undocumented)
194
+ orderSequentially<T>(callback: () => T): T;
195
+ // (undocumented)
196
+ process(messageArg: ISequencedDocumentMessage, local: boolean): void;
197
+ // (undocumented)
198
+ processSignal(message: ISignalMessage, local: boolean): void;
199
+ refreshLatestSummaryAck(options: IRefreshSummaryAckOptions): Promise<void>;
200
+ // @deprecated
201
+ request(request: IRequest): Promise<IResponse>;
202
+ resolveHandle(request: IRequest): Promise<IResponse>;
203
+ // (undocumented)
204
+ get scope(): FluidObject;
205
+ // (undocumented)
206
+ setAttachState(attachState: AttachState.Attaching | AttachState.Attached): void;
207
+ // (undocumented)
208
+ setConnectionState(connected: boolean, clientId?: string): void;
209
+ // (undocumented)
210
+ get storage(): IDocumentStorageService;
211
+ // (undocumented)
212
+ submitDataStoreAliasOp(contents: any, localOpMetadata: unknown): void;
213
+ // (undocumented)
214
+ submitDataStoreOp(id: string, contents: any, localOpMetadata?: unknown): void;
215
+ // (undocumented)
216
+ submitDataStoreSignal(address: string, type: string, content: any): void;
217
+ submitSignal(type: string, content: any): void;
218
+ submitSummary(options: ISubmitSummaryOptions): Promise<SubmitSummaryResult>;
219
+ summarize(options: {
220
+ fullTree?: boolean;
221
+ trackState?: boolean;
222
+ summaryLogger?: ITelemetryLoggerExt;
223
+ runGC?: boolean;
224
+ fullGC?: boolean;
225
+ runSweep?: boolean;
226
+ }): Promise<ISummaryTreeWithStats>;
227
+ // (undocumented)
228
+ summarizeOnDemand(options: IOnDemandSummarizeOptions): ISummarizeResults;
229
+ get summarizerClientId(): string | undefined;
230
+ updateStateBeforeGC(): Promise<void>;
231
+ updateTombstonedRoutes(tombstonedRoutes: string[]): void;
232
+ updateUnusedRoutes(unusedRoutes: string[]): void;
233
+ updateUsedRoutes(usedRoutes: string[]): void;
234
+ // (undocumented)
235
+ uploadBlob(blob: ArrayBufferLike, signal?: AbortSignal): Promise<IFluidHandle<ArrayBufferLike>>;
236
+ }
237
+
238
+ // @internal @deprecated
239
+ export interface ContainerRuntimeMessage {
240
+ compatDetails?: IContainerRuntimeMessageCompatDetails;
241
+ contents: any;
242
+ type: ContainerMessageType;
243
+ }
244
+
245
+ // @public (undocumented)
246
+ export const DefaultSummaryConfiguration: ISummaryConfiguration;
247
+
248
+ // @public (undocumented)
249
+ export type EnqueueSummarizeResult = (ISummarizeResults & {
250
+ readonly alreadyEnqueued?: undefined;
251
+ }) | (ISummarizeResults & {
252
+ readonly alreadyEnqueued: true;
253
+ readonly overridden: true;
254
+ }) | {
255
+ readonly alreadyEnqueued: true;
256
+ readonly overridden?: undefined;
257
+ };
258
+
259
+ // @public (undocumented)
260
+ export class FluidDataStoreRegistry implements IFluidDataStoreRegistry {
261
+ constructor(namedEntries: NamedFluidDataStoreRegistryEntries);
262
+ // (undocumented)
263
+ get(name: string): Promise<FluidDataStoreRegistryEntry | undefined>;
264
+ // (undocumented)
265
+ get IFluidDataStoreRegistry(): this;
266
+ }
267
+
268
+ // @public
269
+ export function generateStableId(): StableId;
270
+
271
+ // @public
272
+ export interface IAckedSummary {
273
+ // (undocumented)
274
+ readonly summaryAck: ISummaryAckMessage;
275
+ // (undocumented)
276
+ readonly summaryOp: ISummaryOpMessage;
277
+ }
278
+
279
+ // @public (undocumented)
280
+ export interface IAckSummaryResult {
281
+ // (undocumented)
282
+ readonly ackNackDuration: number;
283
+ // (undocumented)
284
+ readonly summaryAckOp: ISummaryAckMessage;
285
+ }
286
+
287
+ // @public
288
+ export interface IBaseSummarizeResult {
289
+ readonly error: any;
290
+ // (undocumented)
291
+ readonly minimumSequenceNumber: number;
292
+ readonly referenceSequenceNumber: number;
293
+ // (undocumented)
294
+ readonly stage: "base";
295
+ }
296
+
297
+ // @public (undocumented)
298
+ export interface IBroadcastSummaryResult {
299
+ // (undocumented)
300
+ readonly broadcastDuration: number;
301
+ // (undocumented)
302
+ readonly summarizeOp: ISummaryOpMessage;
303
+ }
304
+
305
+ // @public (undocumented)
306
+ export interface ICancellableSummarizerController extends ISummaryCancellationToken {
307
+ // (undocumented)
308
+ stop(reason: SummarizerStopReason): void;
309
+ }
310
+
311
+ // @public
312
+ export interface ICancellationToken<T> {
313
+ readonly cancelled: boolean;
314
+ readonly waitCancelled: Promise<T>;
315
+ }
316
+
317
+ // @public (undocumented)
318
+ export interface IChunkedOp {
319
+ // (undocumented)
320
+ chunkId: number;
321
+ // (undocumented)
322
+ contents: string;
323
+ // (undocumented)
324
+ originalCompression?: string;
325
+ // (undocumented)
326
+ originalMetadata?: Record<string, unknown>;
327
+ // (undocumented)
328
+ originalType: MessageType | ContainerMessageType;
329
+ // (undocumented)
330
+ totalChunks: number;
331
+ }
332
+
333
+ // @public
334
+ export interface IClientSummaryWatcher extends IDisposable {
335
+ // (undocumented)
336
+ waitFlushed(): Promise<IAckedSummary | undefined>;
337
+ // (undocumented)
338
+ watchSummary(clientSequenceNumber: number): ISummary;
339
+ }
340
+
341
+ // @public
342
+ export interface ICompressionRuntimeOptions {
343
+ readonly compressionAlgorithm: CompressionAlgorithms;
344
+ readonly minimumBatchSizeInBytes: number;
345
+ }
346
+
347
+ // @public (undocumented)
348
+ export interface IConnectableRuntime {
349
+ // (undocumented)
350
+ readonly clientId: string | undefined;
351
+ // (undocumented)
352
+ readonly connected: boolean;
353
+ // (undocumented)
354
+ readonly disposed: boolean;
355
+ // (undocumented)
356
+ once(event: "connected" | "disconnected" | "dispose", listener: () => void): this;
357
+ }
358
+
359
+ // @internal
360
+ export interface IContainerRuntimeMessageCompatDetails {
361
+ behavior: CompatModeBehavior;
362
+ }
363
+
364
+ // @public
365
+ export interface IContainerRuntimeOptions {
366
+ readonly chunkSizeInBytes?: number;
367
+ readonly compressionOptions?: ICompressionRuntimeOptions;
368
+ readonly enableGroupedBatching?: boolean;
369
+ readonly enableOpReentryCheck?: boolean;
370
+ readonly enableRuntimeIdCompressor?: boolean;
371
+ readonly flushMode?: FlushMode;
372
+ // (undocumented)
373
+ readonly gcOptions?: IGCRuntimeOptions;
374
+ readonly loadSequenceNumberVerification?: "close" | "log" | "bypass";
375
+ readonly maxBatchSizeInBytes?: number;
376
+ // (undocumented)
377
+ readonly summaryOptions?: ISummaryRuntimeOptions;
378
+ }
379
+
380
+ // @public
381
+ export interface IEnqueueSummarizeOptions extends IOnDemandSummarizeOptions {
382
+ readonly afterSequenceNumber?: number;
383
+ readonly override?: boolean;
384
+ }
385
+
386
+ // @public (undocumented)
387
+ export interface IGCRuntimeOptions {
388
+ [key: string]: any;
389
+ disableGC?: boolean;
390
+ gcAllowed?: boolean;
391
+ runFullGC?: boolean;
392
+ sessionExpiryTimeoutMs?: number;
393
+ }
394
+
395
+ // @public
396
+ export interface IGCStats {
397
+ attachmentBlobCount: number;
398
+ dataStoreCount: number;
399
+ nodeCount: number;
400
+ unrefAttachmentBlobCount: number;
401
+ unrefDataStoreCount: number;
402
+ unrefNodeCount: number;
403
+ updatedAttachmentBlobCount: number;
404
+ updatedDataStoreCount: number;
405
+ updatedNodeCount: number;
406
+ }
407
+
408
+ // @public
409
+ export interface IGeneratedSummaryStats extends ISummaryStats {
410
+ readonly dataStoreCount: number;
411
+ readonly gcBlobNodeCount?: number;
412
+ readonly gcStateUpdatedDataStoreCount?: number;
413
+ readonly gcTotalBlobsSize?: number;
414
+ readonly summarizedDataStoreCount: number;
415
+ readonly summaryNumber: number;
416
+ }
417
+
418
+ // @public
419
+ export interface IGenerateSummaryTreeResult extends Omit<IBaseSummarizeResult, "stage"> {
420
+ readonly forcedFullTree: boolean;
421
+ readonly generateDuration: number;
422
+ // (undocumented)
423
+ readonly stage: "generate";
424
+ readonly summaryStats: IGeneratedSummaryStats;
425
+ readonly summaryTree: ISummaryTree;
426
+ }
427
+
428
+ // @public (undocumented)
429
+ export interface INackSummaryResult extends IRetriableFailureResult {
430
+ // (undocumented)
431
+ readonly ackNackDuration: number;
432
+ // (undocumented)
433
+ readonly summaryNackOp: ISummaryNackMessage;
434
+ }
435
+
436
+ // @public
437
+ export const InactiveResponseHeaderKey = "isInactive";
438
+
439
+ // @public (undocumented)
440
+ export interface IOnDemandSummarizeOptions extends ISummarizeOptions {
441
+ readonly reason: string;
442
+ }
443
+
444
+ // @public
445
+ export interface IRefreshSummaryAckOptions {
446
+ readonly ackHandle: string;
447
+ readonly proposalHandle: string | undefined;
448
+ readonly summaryLogger: ITelemetryLoggerExt;
449
+ readonly summaryRefSeq: number;
450
+ }
451
+
452
+ // @public
453
+ export interface IRetriableFailureResult {
454
+ // (undocumented)
455
+ readonly retryAfterSeconds?: number;
456
+ }
457
+
458
+ // @public @deprecated (undocumented)
459
+ export function isRuntimeMessage(message: ISequencedDocumentMessage): boolean;
460
+
461
+ // @public
462
+ export function isStableId(str: string): str is StableId;
463
+
464
+ // @public
465
+ export interface ISubmitSummaryOpResult extends Omit<IUploadSummaryResult, "stage" | "error"> {
466
+ readonly clientSequenceNumber: number;
467
+ // (undocumented)
468
+ readonly stage: "submit";
469
+ readonly submitOpDuration: number;
470
+ }
471
+
472
+ // @public (undocumented)
473
+ export interface ISubmitSummaryOptions extends ISummarizeOptions {
474
+ readonly cancellationToken: ISummaryCancellationToken;
475
+ readonly finalAttempt?: boolean;
476
+ readonly summaryLogger: ITelemetryLoggerExt;
477
+ }
478
+
479
+ // @public (undocumented)
480
+ export interface ISummarizeEventProps {
481
+ // (undocumented)
482
+ currentAttempt: number;
483
+ // (undocumented)
484
+ error?: any;
485
+ // (undocumented)
486
+ maxAttempts: number;
487
+ // (undocumented)
488
+ result: "success" | "failure" | "canceled";
489
+ }
490
+
491
+ // @public
492
+ export interface ISummarizeOptions {
493
+ readonly fullTree?: boolean;
494
+ // @deprecated
495
+ readonly refreshLatestAck?: boolean;
496
+ }
497
+
498
+ // @public (undocumented)
499
+ export interface ISummarizer extends IEventProvider<ISummarizerEvents> {
500
+ // (undocumented)
501
+ close(): void;
502
+ enqueueSummarize(options: IEnqueueSummarizeOptions): EnqueueSummarizeResult;
503
+ readonly ISummarizer?: ISummarizer;
504
+ // (undocumented)
505
+ run(onBehalfOf: string, disableHeuristics?: boolean): Promise<SummarizerStopReason>;
506
+ // (undocumented)
507
+ stop(reason: SummarizerStopReason): void;
508
+ summarizeOnDemand(options: IOnDemandSummarizeOptions): ISummarizeResults;
509
+ }
510
+
511
+ // @public (undocumented)
512
+ export interface ISummarizeResults {
513
+ readonly receivedSummaryAckOrNack: Promise<SummarizeResultPart<IAckSummaryResult, INackSummaryResult>>;
514
+ readonly summaryOpBroadcasted: Promise<SummarizeResultPart<IBroadcastSummaryResult>>;
515
+ readonly summarySubmitted: Promise<SummarizeResultPart<SubmitSummaryResult, SubmitSummaryFailureData>>;
516
+ }
517
+
518
+ // @public (undocumented)
519
+ export interface ISummarizerEvents extends IEvent {
520
+ // (undocumented)
521
+ (event: "summarize", listener: (props: ISummarizeEventProps) => void): any;
522
+ }
523
+
524
+ // @public (undocumented)
525
+ export interface ISummarizerInternalsProvider {
526
+ refreshLatestSummaryAck(options: IRefreshSummaryAckOptions): Promise<void>;
527
+ submitSummary(options: ISubmitSummaryOptions): Promise<SubmitSummaryResult>;
528
+ }
529
+
530
+ // @public (undocumented)
531
+ export interface ISummarizerRuntime extends IConnectableRuntime {
532
+ // (undocumented)
533
+ closeFn(): void;
534
+ // (undocumented)
535
+ readonly deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>;
536
+ // (undocumented)
537
+ disposeFn(): void;
538
+ // (undocumented)
539
+ readonly logger: ITelemetryLoggerExt;
540
+ // (undocumented)
541
+ off(event: "op", listener: (op: ISequencedDocumentMessage, runtimeMessage?: boolean) => void): this;
542
+ // (undocumented)
543
+ on(event: "op", listener: (op: ISequencedDocumentMessage, runtimeMessage?: boolean) => void): this;
544
+ readonly summarizerClientId: string | undefined;
545
+ }
546
+
547
+ // @public (undocumented)
548
+ export interface ISummarizingWarning extends ContainerWarning {
549
+ // (undocumented)
550
+ readonly errorType: "summarizingError";
551
+ // (undocumented)
552
+ readonly logged: boolean;
553
+ }
554
+
555
+ // @public
556
+ export interface ISummary {
557
+ // (undocumented)
558
+ readonly clientId: string;
559
+ // (undocumented)
560
+ readonly clientSequenceNumber: number;
561
+ // (undocumented)
562
+ waitAckNack(): Promise<ISummaryAckMessage | ISummaryNackMessage>;
563
+ // (undocumented)
564
+ waitBroadcast(): Promise<ISummaryOpMessage>;
565
+ }
566
+
567
+ // @public
568
+ export interface ISummaryAckMessage extends ISequencedDocumentMessage {
569
+ // (undocumented)
570
+ contents: ISummaryAck;
571
+ // (undocumented)
572
+ type: MessageType.SummaryAck;
573
+ }
574
+
575
+ // @public (undocumented)
576
+ export interface ISummaryBaseConfiguration {
577
+ initialSummarizerDelayMs: number;
578
+ maxAckWaitTime: number;
579
+ maxOpsSinceLastSummary: number;
580
+ }
581
+
582
+ // @public (undocumented)
583
+ export type ISummaryCancellationToken = ICancellationToken<SummarizerStopReason>;
584
+
585
+ // @public (undocumented)
586
+ export interface ISummaryCollectionOpEvents extends IEvent {
587
+ // (undocumented)
588
+ (event: OpActionEventName, listener: OpActionEventListener): any;
589
+ }
590
+
591
+ // @public (undocumented)
592
+ export type ISummaryConfiguration = ISummaryConfigurationDisableSummarizer | ISummaryConfigurationDisableHeuristics | ISummaryConfigurationHeuristics;
593
+
594
+ // @public (undocumented)
595
+ export interface ISummaryConfigurationDisableHeuristics extends ISummaryBaseConfiguration {
596
+ // (undocumented)
597
+ state: "disableHeuristics";
598
+ }
599
+
600
+ // @public (undocumented)
601
+ export interface ISummaryConfigurationDisableSummarizer {
602
+ // (undocumented)
603
+ state: "disabled";
604
+ }
605
+
606
+ // @public (undocumented)
607
+ export interface ISummaryConfigurationHeuristics extends ISummaryBaseConfiguration {
608
+ maxIdleTime: number;
609
+ maxOps: number;
610
+ maxTime: number;
611
+ minIdleTime: number;
612
+ minOpsForLastSummaryAttempt: number;
613
+ nonRuntimeHeuristicThreshold?: number;
614
+ nonRuntimeOpWeight: number;
615
+ runtimeOpWeight: number;
616
+ // (undocumented)
617
+ state: "enabled";
618
+ }
619
+
620
+ // @public
621
+ export interface ISummaryNackMessage extends ISequencedDocumentMessage {
622
+ // (undocumented)
623
+ contents: ISummaryNack;
624
+ // (undocumented)
625
+ type: MessageType.SummaryNack;
626
+ }
627
+
628
+ // @public
629
+ export interface ISummaryOpMessage extends ISequencedDocumentMessage {
630
+ // (undocumented)
631
+ contents: ISummaryContent;
632
+ // (undocumented)
633
+ type: MessageType.Summarize;
634
+ }
635
+
636
+ // @public (undocumented)
637
+ export interface ISummaryRuntimeOptions {
638
+ // @deprecated
639
+ initialSummarizerDelayMs?: number;
640
+ summaryConfigOverrides?: ISummaryConfiguration;
641
+ }
642
+
643
+ // @public
644
+ export interface IUploadSummaryResult extends Omit<IGenerateSummaryTreeResult, "stage"> {
645
+ readonly handle: string;
646
+ // (undocumented)
647
+ readonly stage: "upload";
648
+ readonly uploadDuration: number;
649
+ }
650
+
651
+ // @public
652
+ export const neverCancelledSummaryToken: ISummaryCancellationToken;
653
+
654
+ // @public (undocumented)
655
+ export type OpActionEventListener = (op: ISequencedDocumentMessage) => void;
656
+
657
+ // @public (undocumented)
658
+ export type OpActionEventName = MessageType.Summarize | MessageType.SummaryAck | MessageType.SummaryNack | "default";
659
+
660
+ // @internal
661
+ export interface RecentlyAddedContainerRuntimeMessageDetails {
662
+ compatDetails: IContainerRuntimeMessageCompatDetails;
663
+ }
664
+
665
+ // @public
666
+ export enum RuntimeHeaders {
667
+ viaHandle = "viaHandle",
668
+ wait = "wait"
669
+ }
670
+
671
+ // @public @deprecated (undocumented)
672
+ export enum RuntimeMessage {
673
+ // (undocumented)
674
+ Alias = "alias",
675
+ // (undocumented)
676
+ Attach = "attach",
677
+ // (undocumented)
678
+ BlobAttach = "blobAttach",
679
+ // (undocumented)
680
+ ChunkedOp = "chunkedOp",
681
+ // (undocumented)
682
+ FluidDataStoreOp = "component",
683
+ // (undocumented)
684
+ Operation = "op",
685
+ // (undocumented)
686
+ Rejoin = "rejoin"
687
+ }
688
+
689
+ // @public
690
+ export interface SubmitSummaryFailureData extends IRetriableFailureResult {
691
+ // (undocumented)
692
+ stage: SummaryStage;
693
+ }
694
+
695
+ // @public
696
+ export type SubmitSummaryResult = IBaseSummarizeResult | IGenerateSummaryTreeResult | IUploadSummaryResult | ISubmitSummaryOpResult;
697
+
698
+ // @public
699
+ export class Summarizer extends TypedEventEmitter<ISummarizerEvents> implements ISummarizer {
700
+ constructor(
701
+ runtime: ISummarizerRuntime, configurationGetter: () => ISummaryConfiguration,
702
+ internalsProvider: ISummarizerInternalsProvider, handleContext: IFluidHandleContext, summaryCollection: SummaryCollection, runCoordinatorCreateFn: (runtime: IConnectableRuntime) => Promise<ICancellableSummarizerController>);
703
+ // (undocumented)
704
+ close(): void;
705
+ // @deprecated
706
+ static create(loader: ILoader, url: string): Promise<ISummarizer>;
707
+ dispose(): void;
708
+ // (undocumented)
709
+ enqueueSummarize(options: IEnqueueSummarizeOptions): EnqueueSummarizeResult;
710
+ // (undocumented)
711
+ get ISummarizer(): this;
712
+ // (undocumented)
713
+ recordSummaryAttempt?(summaryRefSeqNum?: number): void;
714
+ // (undocumented)
715
+ run(onBehalfOf: string): Promise<SummarizerStopReason>;
716
+ stop(reason: SummarizerStopReason): void;
717
+ static stopReasonCanRunLastSummary(stopReason: SummarizerStopReason): boolean;
718
+ // (undocumented)
719
+ summarizeOnDemand(options: IOnDemandSummarizeOptions): ISummarizeResults;
720
+ // (undocumented)
721
+ readonly summaryCollection: SummaryCollection;
722
+ }
723
+
724
+ // @public (undocumented)
725
+ export type SummarizeResultPart<TSuccess, TFailure = undefined> = {
726
+ success: true;
727
+ data: TSuccess;
728
+ } | {
729
+ success: false;
730
+ data: TFailure | undefined;
731
+ message: string;
732
+ error: any;
733
+ };
734
+
735
+ // @public (undocumented)
736
+ export type SummarizerStopReason =
737
+ /** Summarizer client failed to summarize in all 3 consecutive attempts. */
738
+ "failToSummarize"
739
+ /** Parent client reported that it is no longer connected. */
740
+ | "parentNotConnected"
741
+ /**
742
+ * Parent client reported that it is no longer elected the summarizer.
743
+ * This is the normal flow; a disconnect will always trigger the parent
744
+ * client to no longer be elected as responsible for summaries. Then it
745
+ * tries to stop its spawned summarizer client.
746
+ */
747
+ | "notElectedParent"
748
+ /**
749
+ * We are not already running the summarizer and we are not the current elected client id.
750
+ */
751
+ | "notElectedClient"
752
+ /** Summarizer client was disconnected */
753
+ | "summarizerClientDisconnected"
754
+ /** running summarizer threw an exception */
755
+ | "summarizerException"
756
+ /**
757
+ * The previous summary state on the summarizer is not the most recently acked summary. this also happens when the
758
+ * first submitSummary attempt fails for any reason and there's a 2nd summary attempt without an ack
759
+ */
760
+ | "latestSummaryStateStale";
761
+
762
+ // @public
763
+ export class SummaryCollection extends TypedEventEmitter<ISummaryCollectionOpEvents> {
764
+ constructor(deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>, logger: ITelemetryLoggerExt);
765
+ // (undocumented)
766
+ addOpListener(listener: () => void): void;
767
+ createWatcher(clientId: string): IClientSummaryWatcher;
768
+ // (undocumented)
769
+ emit(event: OpActionEventName, ...args: Parameters<OpActionEventListener>): boolean;
770
+ // (undocumented)
771
+ get latestAck(): IAckedSummary | undefined;
772
+ // (undocumented)
773
+ get opsSinceLastAck(): number;
774
+ // (undocumented)
775
+ removeOpListener(listener: () => void): void;
776
+ // (undocumented)
777
+ removeWatcher(clientId: string): void;
778
+ // (undocumented)
779
+ setPendingAckTimerTimeoutCallback(maxAckWaitTime: number, timeoutCallback: () => void): void;
780
+ // (undocumented)
781
+ unsetPendingAckTimerTimeoutCallback(): void;
782
+ waitFlushed(): Promise<IAckedSummary | undefined>;
783
+ waitSummaryAck(referenceSequenceNumber: number): Promise<IAckedSummary>;
784
+ }
785
+
786
+ // @public
787
+ export type SummaryStage = SubmitSummaryResult["stage"] | "unknown";
788
+
789
+ // @public
790
+ export function TEST_requestSummarizer(loader: ILoader, url: string): Promise<ISummarizer>;
791
+
792
+ // @public
793
+ export const TombstoneResponseHeaderKey = "isTombstoned";
794
+
795
+ // @internal
796
+ export function unpackRuntimeMessage(message: ISequencedDocumentMessage): boolean;
797
+
798
+ // (No @packageDocumentation comment for this package)
799
+
800
+ ```