/*! * Copyright (c) Microsoft Corporation and contributors. All rights reserved. * Licensed under the MIT License. */ import { TypedEventEmitter } from "@fluid-internal/client-utils"; import type { ISummarizerEvents, SummarizerStopReason } from "@fluidframework/container-runtime-definitions/internal"; import type { IFluidHandleContext } from "@fluidframework/core-interfaces/internal"; import { type IFluidErrorBase, type ITelemetryLoggerExt, LoggingError } from "@fluidframework/telemetry-utils/internal"; import type { IConnectableRuntime, IEnqueueSummarizeOptions, IOnDemandSummarizeOptions, ISummarizer, ISummarizerInternalsProvider, ISummarizerRuntime, ISummarizingWarning, ISummaryConfiguration } from "../summarizerTypes.js"; import type { SummaryCollection } from "../summaryCollection.js"; import type { ICancellableSummarizerController } from "./runWhileConnectedCoordinator.js"; import type { EnqueueSummarizeResult, ISummarizeResults } from "./summaryResultTypes.js"; /** * The maximum number of summarization attempts that will be done by default in case of failures * that can be retried. */ export declare const defaultMaxAttempts = 2; /** * The default value for maximum number of summarization attempts that will be done for summarization failures where * submit fails and the failure can be retried. */ export declare const defaultMaxAttemptsForSubmitFailures = 5; export declare class SummarizingWarning extends LoggingError implements ISummarizingWarning, IFluidErrorBase { readonly logged: boolean; readonly errorType = "summarizingError"; readonly canRetry = true; constructor(errorMessage: string, logged?: boolean); static wrap(error: unknown, logged: boolean | undefined, logger: ITelemetryLoggerExt): SummarizingWarning; } export declare const createSummarizingWarning: (errorMessage: string, logged: boolean) => SummarizingWarning; /** * Summarizer is responsible for coordinating when to generate and send summaries. * It is the main entry point for summary work. * It is created only by summarizing container (i.e. one with clientType === "summarizer") * @internal */ export declare class Summarizer extends TypedEventEmitter implements ISummarizer { /** * Reference to runtime that created this object. * i.e. runtime with clientType === "summarizer" */ private readonly runtime; private readonly configurationGetter; /** * Represents an object that can generate summary. * In practical terms, it's same runtime (this.runtime) with clientType === "summarizer". */ private readonly internalsProvider; readonly summaryCollection: SummaryCollection; private readonly runCoordinatorCreateFn; get ISummarizer(): this; private readonly logger; private runningSummarizer?; private _disposed; private starting; private readonly stopDeferred; constructor( /** * Reference to runtime that created this object. * i.e. runtime with clientType === "summarizer" */ runtime: ISummarizerRuntime, configurationGetter: () => ISummaryConfiguration, /** * Represents an object that can generate summary. * In practical terms, it's same runtime (this.runtime) with clientType === "summarizer". */ internalsProvider: ISummarizerInternalsProvider, handleContext: IFluidHandleContext, summaryCollection: SummaryCollection, runCoordinatorCreateFn: (runtime: IConnectableRuntime) => Promise); run(onBehalfOf: string): Promise; /** * Stops the summarizer from running. This will complete * the run promise, and also close the container. * @param reason - reason code for stopping */ stop(reason: SummarizerStopReason): void; close(): void; private runCore; /** * Should we try to run a last summary for the given stop reason? * Currently only allows "parentNotConnected" * @param stopReason - SummarizerStopReason * @returns `true` if the stop reason can run a last summary, otherwise `false`. */ static stopReasonCanRunLastSummary(stopReason: SummarizerStopReason): boolean; private _heuristicData; /** * Put the summarizer in a started state, including creating and initializing the RunningSummarizer. * The start request can come either from the SummaryManager (in the auto-summarize case) or from the user * (in the on-demand case). * @param onBehalfOf - ID of the client that requested that the summarizer start * @param runCoordinator - cancellation token * @param newConfig - Summary configuration to override the existing config when invoking the RunningSummarizer. * @returns A promise that is fulfilled when the RunningSummarizer is ready. */ private start; /** * Disposes of resources after running. This cleanup will * clear any outstanding timers and reset some of the state * properties. * Called by ContainerRuntime when it is disposed, as well as at the end the run(). */ dispose(): void; summarizeOnDemand(options: IOnDemandSummarizeOptions): ISummarizeResults; enqueueSummarize(options: IEnqueueSummarizeOptions): EnqueueSummarizeResult; recordSummaryAttempt?(summaryRefSeqNum?: number): void; private readonly forwardedEventsCleanup; private setupForwardedEvents; private cleanupForwardedEvents; } //# sourceMappingURL=summarizer.d.ts.map