@fluidframework/container-runtime 2.74.0-370705 → 2.80.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 (117) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/container-runtime.test-files.tar +0 -0
  3. package/dist/blobManager/blobManager.d.ts +0 -2
  4. package/dist/blobManager/blobManager.d.ts.map +1 -1
  5. package/dist/blobManager/blobManager.js +4 -5
  6. package/dist/blobManager/blobManager.js.map +1 -1
  7. package/dist/channelCollection.d.ts +3 -3
  8. package/dist/channelCollection.d.ts.map +1 -1
  9. package/dist/channelCollection.js +20 -2
  10. package/dist/channelCollection.js.map +1 -1
  11. package/dist/containerRuntime.d.ts +5 -0
  12. package/dist/containerRuntime.d.ts.map +1 -1
  13. package/dist/containerRuntime.js +13 -7
  14. package/dist/containerRuntime.js.map +1 -1
  15. package/dist/dataStoreContext.d.ts +1 -1
  16. package/dist/dataStoreContext.d.ts.map +1 -1
  17. package/dist/dataStoreContext.js +1 -1
  18. package/dist/dataStoreContext.js.map +1 -1
  19. package/dist/dataStoreContexts.d.ts +56 -9
  20. package/dist/dataStoreContexts.d.ts.map +1 -1
  21. package/dist/dataStoreContexts.js +56 -9
  22. package/dist/dataStoreContexts.js.map +1 -1
  23. package/dist/packageVersion.d.ts +1 -1
  24. package/dist/packageVersion.d.ts.map +1 -1
  25. package/dist/packageVersion.js +1 -1
  26. package/dist/packageVersion.js.map +1 -1
  27. package/dist/runtimeLayerCompatState.d.ts +10 -6
  28. package/dist/runtimeLayerCompatState.d.ts.map +1 -1
  29. package/dist/runtimeLayerCompatState.js +16 -6
  30. package/dist/runtimeLayerCompatState.js.map +1 -1
  31. package/dist/summary/summarizerClientElection.d.ts.map +1 -1
  32. package/dist/summary/summarizerClientElection.js +1 -0
  33. package/dist/summary/summarizerClientElection.js.map +1 -1
  34. package/dist/summary/summarizerTypes.d.ts +5 -0
  35. package/dist/summary/summarizerTypes.d.ts.map +1 -1
  36. package/dist/summary/summarizerTypes.js.map +1 -1
  37. package/dist/summary/summaryDelayLoadedModule/runningSummarizer.d.ts +3 -1
  38. package/dist/summary/summaryDelayLoadedModule/runningSummarizer.d.ts.map +1 -1
  39. package/dist/summary/summaryDelayLoadedModule/runningSummarizer.js +39 -18
  40. package/dist/summary/summaryDelayLoadedModule/runningSummarizer.js.map +1 -1
  41. package/dist/summary/summaryDelayLoadedModule/summarizer.d.ts +1 -1
  42. package/dist/summary/summaryDelayLoadedModule/summarizer.d.ts.map +1 -1
  43. package/dist/summary/summaryDelayLoadedModule/summarizer.js +13 -11
  44. package/dist/summary/summaryDelayLoadedModule/summarizer.js.map +1 -1
  45. package/dist/summary/summaryDelayLoadedModule/summaryGenerator.d.ts +4 -1
  46. package/dist/summary/summaryDelayLoadedModule/summaryGenerator.d.ts.map +1 -1
  47. package/dist/summary/summaryDelayLoadedModule/summaryGenerator.js +30 -9
  48. package/dist/summary/summaryDelayLoadedModule/summaryGenerator.js.map +1 -1
  49. package/dist/summary/summaryManager.d.ts +1 -1
  50. package/dist/summary/summaryManager.d.ts.map +1 -1
  51. package/dist/summary/summaryManager.js +10 -9
  52. package/dist/summary/summaryManager.js.map +1 -1
  53. package/eslint.config.mts +31 -0
  54. package/lib/blobManager/blobManager.d.ts +0 -2
  55. package/lib/blobManager/blobManager.d.ts.map +1 -1
  56. package/lib/blobManager/blobManager.js +4 -5
  57. package/lib/blobManager/blobManager.js.map +1 -1
  58. package/lib/channelCollection.d.ts +3 -3
  59. package/lib/channelCollection.d.ts.map +1 -1
  60. package/lib/channelCollection.js +20 -2
  61. package/lib/channelCollection.js.map +1 -1
  62. package/lib/containerRuntime.d.ts +5 -0
  63. package/lib/containerRuntime.d.ts.map +1 -1
  64. package/lib/containerRuntime.js +13 -7
  65. package/lib/containerRuntime.js.map +1 -1
  66. package/lib/dataStoreContext.d.ts +1 -1
  67. package/lib/dataStoreContext.d.ts.map +1 -1
  68. package/lib/dataStoreContext.js +1 -1
  69. package/lib/dataStoreContext.js.map +1 -1
  70. package/lib/dataStoreContexts.d.ts +56 -9
  71. package/lib/dataStoreContexts.d.ts.map +1 -1
  72. package/lib/dataStoreContexts.js +56 -9
  73. package/lib/dataStoreContexts.js.map +1 -1
  74. package/lib/packageVersion.d.ts +1 -1
  75. package/lib/packageVersion.d.ts.map +1 -1
  76. package/lib/packageVersion.js +1 -1
  77. package/lib/packageVersion.js.map +1 -1
  78. package/lib/runtimeLayerCompatState.d.ts +10 -6
  79. package/lib/runtimeLayerCompatState.d.ts.map +1 -1
  80. package/lib/runtimeLayerCompatState.js +15 -5
  81. package/lib/runtimeLayerCompatState.js.map +1 -1
  82. package/lib/summary/summarizerClientElection.d.ts.map +1 -1
  83. package/lib/summary/summarizerClientElection.js +1 -0
  84. package/lib/summary/summarizerClientElection.js.map +1 -1
  85. package/lib/summary/summarizerTypes.d.ts +5 -0
  86. package/lib/summary/summarizerTypes.d.ts.map +1 -1
  87. package/lib/summary/summarizerTypes.js.map +1 -1
  88. package/lib/summary/summaryDelayLoadedModule/runningSummarizer.d.ts +3 -1
  89. package/lib/summary/summaryDelayLoadedModule/runningSummarizer.d.ts.map +1 -1
  90. package/lib/summary/summaryDelayLoadedModule/runningSummarizer.js +39 -18
  91. package/lib/summary/summaryDelayLoadedModule/runningSummarizer.js.map +1 -1
  92. package/lib/summary/summaryDelayLoadedModule/summarizer.d.ts +1 -1
  93. package/lib/summary/summaryDelayLoadedModule/summarizer.d.ts.map +1 -1
  94. package/lib/summary/summaryDelayLoadedModule/summarizer.js +13 -11
  95. package/lib/summary/summaryDelayLoadedModule/summarizer.js.map +1 -1
  96. package/lib/summary/summaryDelayLoadedModule/summaryGenerator.d.ts +4 -1
  97. package/lib/summary/summaryDelayLoadedModule/summaryGenerator.d.ts.map +1 -1
  98. package/lib/summary/summaryDelayLoadedModule/summaryGenerator.js +26 -5
  99. package/lib/summary/summaryDelayLoadedModule/summaryGenerator.js.map +1 -1
  100. package/lib/summary/summaryManager.d.ts +1 -1
  101. package/lib/summary/summaryManager.d.ts.map +1 -1
  102. package/lib/summary/summaryManager.js +10 -9
  103. package/lib/summary/summaryManager.js.map +1 -1
  104. package/package.json +27 -26
  105. package/src/blobManager/blobManager.ts +3 -7
  106. package/src/channelCollection.ts +29 -5
  107. package/src/containerRuntime.ts +19 -6
  108. package/src/dataStoreContext.ts +2 -2
  109. package/src/dataStoreContexts.ts +56 -9
  110. package/src/packageVersion.ts +1 -1
  111. package/src/runtimeLayerCompatState.ts +25 -9
  112. package/src/summary/summarizerClientElection.ts +1 -0
  113. package/src/summary/summarizerTypes.ts +5 -0
  114. package/src/summary/summaryDelayLoadedModule/runningSummarizer.ts +54 -26
  115. package/src/summary/summaryDelayLoadedModule/summarizer.ts +13 -11
  116. package/src/summary/summaryDelayLoadedModule/summaryGenerator.ts +35 -5
  117. package/src/summary/summaryManager.ts +11 -10
@@ -1 +1 @@
1
- {"version":3,"file":"summarizerTypes.d.ts","sourceRoot":"","sources":["../../src/summary/summarizerTypes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACX,aAAa,EACb,gBAAgB,EAChB,MAAM,gDAAgD,CAAC;AACxD,OAAO,KAAK,EACX,iBAAiB,EACjB,oBAAoB,EACpB,MAAM,wDAAwD,CAAC;AAChE,OAAO,KAAK,EACX,cAAc,EACd,wBAAwB,EACxB,oBAAoB,EACpB,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AACvE,OAAO,KAAK,EACX,gBAAgB,EAChB,yBAAyB,EACzB,MAAM,6CAA6C,CAAC;AACrD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8CAA8C,CAAC;AAClF,OAAO,KAAK,EACX,mBAAmB,EACnB,2BAA2B,EAC3B,MAAM,0CAA0C,CAAC;AAElD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,KAAK,EACX,sBAAsB,EACtB,iBA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BAA2B;IAC7E;;OAEG;IACH,cAAc,EAAE,MAAM,MAAM,CAAC;IAC7B;;OAEG;IACH,4BAA4B,EAAE,MAAM,MAAM,CAAC;CAC3C;AAED;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACzC;;OAEG;IACH,wBAAwB,EAAE,MAAM,CAAC;IAEjC;;;;OAIG;IACH,cAAc,EAAE,MAAM,CAAC;IACvB;;;OAGG;IACH,sBAAsB,EAAE,MAAM,CAAC;CAC/B;AAED;;GAEG;AACH,MAAM,WAAW,+BAAgC,SAAQ,yBAAyB;IACjF,KAAK,EAAE,SAAS,CAAC;IACjB;;;;;OAKG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,2BAA2B,EAAE,MAAM,CAAC;IACpC;;;;;;OAMG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB;;;;;;OAMG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB;;;;OAIG;IACH,eAAe,EAAE,MAAM,CAAC;IACxB;;;;OAIG;IACH,kBAAkB,EAAE,MAAM,CAAC;IAE3B;;;;;;;;OAQG;IACH,4BAA4B,CAAC,EAAE,MAAM,CAAC;CACtC;AAED;;GAEG;AACH,MAAM,WAAW,sCAAsC;IACtD,KAAK,EAAE,UAAU,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,sCAAuC,SAAQ,yBAAyB;IACxF,KAAK,EAAE,mBAAmB,CAAC;CAC3B;AAED;;;GAGG;AACH,MAAM,WAAW,yCAA0C,SAAQ,yBAAyB;IAC3F,KAAK,EAAE,kBAAkB,CAAC;CAC1B;AAED;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAC9B,sCAAsC,GACtC,sCAAsC,GACtC,+BAA+B,GAC/B,yCAAyC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"summarizerTypes.js","sourceRoot":"","sources":["../../src/summary/summarizerTypes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAgCH,MAAM,CAAC,MAAM,oBAAoB,GAAG,YAAY,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type {\n\tIDeltaManager,\n\tContainerWarning,\n} from \"@fluidframework/container-definitions/internal\";\nimport type {\n\tISummarizerEvents,\n\tSummarizerStopReason,\n} from \"@fluidframework/container-runtime-definitions/internal\";\nimport type {\n\tIEventProvider,\n\tITelemetryBaseProperties,\n\tITelemetryBaseLogger,\n} from \"@fluidframework/core-interfaces\";\nimport type { ISummaryTree } from \"@fluidframework/driver-definitions\";\nimport type {\n\tIDocumentMessage,\n\tISequencedDocumentMessage,\n} from \"@fluidframework/driver-definitions/internal\";\nimport type { ISummaryStats } from \"@fluidframework/runtime-definitions/internal\";\nimport type {\n\tITelemetryLoggerExt,\n\tITelemetryLoggerPropertyBag,\n} from \"@fluidframework/telemetry-utils/internal\";\n\nimport type { SummarizeReason } from \"./summarizerUtils.js\";\nimport type {\n\tEnqueueSummarizeResult,\n\tISummarizeResults,\n} from \"./summaryDelayLoadedModule/index.js\";\n\nexport const summarizerClientType = \"summarizer\";\n\n/**\n * Similar to AbortSignal, but using promise instead of events\n * @param T - cancellation reason type\n * @internal\n */\nexport interface ICancellationToken<T> {\n\t/**\n\t * Tells if this cancellable token is cancelled\n\t */\n\treadonly cancelled: boolean;\n\t/**\n\t * Promise that gets fulfilled when this cancellable token is cancelled\n\t * @returns reason of cancellation\n\t */\n\treadonly waitCancelled: Promise<T>;\n}\n\n/**\n * Similar to AbortSignal, but using promise instead of events\n * @internal\n */\nexport type ISummaryCancellationToken = ICancellationToken<SummarizerStopReason>;\n\n/**\n * Data required to update internal tracking state after receiving a Summary Ack.\n * @internal\n */\nexport interface IRefreshSummaryAckOptions {\n\t/**\n\t * Handle from the ack's summary op.\n\t */\n\treadonly proposalHandle: string | undefined;\n\t/**\n\t * Handle from the summary ack just received\n\t */\n\treadonly ackHandle: string;\n\t/**\n\t * Reference sequence number from the ack's summary op\n\t */\n\treadonly summaryRefSeq: number;\n\t/**\n\t * Telemetry logger to which telemetry events will be forwarded.\n\t */\n\treadonly summaryLogger: ITelemetryLoggerExt;\n}\n\n/**\n * @internal\n */\nexport interface ISummarizerInternalsProvider {\n\t/**\n\t * Encapsulates the work to walk the internals of the running container to generate a summary\n\t */\n\tsubmitSummary(options: ISubmitSummaryOptions): Promise<SubmitSummaryResult>;\n\n\t/**\n\t * Callback whenever a new SummaryAck is received, to update internal tracking state\n\t */\n\trefreshLatestSummaryAck(options: IRefreshSummaryAckOptions): Promise<void>;\n}\n\n/**\n * @internal\n */\nexport interface ISummarizingWarning extends ContainerWarning {\n\treadonly errorType: \"summarizingError\";\n\treadonly logged: boolean;\n}\n\n/**\n * @internal\n */\nexport interface IConnectableRuntime {\n\treadonly disposed: boolean;\n\treadonly connected: boolean;\n\treadonly clientId: string | undefined;\n\tonce(event: \"connected\" | \"disconnected\" | \"dispose\", listener: () => void): this;\n}\n\n/**\n * @internal\n */\nexport interface ISummarizerRuntime extends IConnectableRuntime {\n\treadonly baseLogger: ITelemetryBaseLogger;\n\t/**\n\t * clientId of parent (non-summarizing) container that owns summarizer container\n\t */\n\treadonly summarizerClientId: string | undefined;\n\treadonly deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>;\n\tdisposeFn(): void;\n\tcloseFn(): void;\n\ton(\n\t\tevent: \"op\",\n\t\tlistener: (op: ISequencedDocumentMessage, runtimeMessage?: boolean) => void,\n\t): this;\n\toff(\n\t\tevent: \"op\",\n\t\tlistener: (op: ISequencedDocumentMessage, runtimeMessage?: boolean) => void,\n\t): this;\n}\n\n/**\n * Options affecting summarize behavior.\n * @legacy @beta\n */\nexport interface ISummarizeOptions {\n\t/**\n\t * True to generate the full tree with no handle reuse optimizations; defaults to false\n\t */\n\treadonly fullTree?: boolean;\n}\n\n/**\n * @internal\n */\nexport interface ISubmitSummaryOptions extends ISummarizeOptions {\n\t/**\n\t * Logger to use for correlated summary events\n\t */\n\treadonly summaryLogger: ITelemetryLoggerExt;\n\t/**\n\t * Tells when summary process should be cancelled\n\t */\n\treadonly cancellationToken: ISummaryCancellationToken;\n\t/**\n\t * Summarization may be attempted multiple times. This tells whether this is the final summarization attempt.\n\t */\n\treadonly finalAttempt?: boolean;\n\t/**\n\t * The sequence number of the latest summary used to validate if summary state is correct before summarizing\n\t */\n\treadonly latestSummaryRefSeqNum: number;\n}\n\n/**\n * @legacy @beta\n */\nexport interface IOnDemandSummarizeOptions extends ISummarizeOptions {\n\t/**\n\t * Reason for generating summary.\n\t */\n\treadonly reason: string;\n\t/**\n\t * In case of a failure, will attempt to retry based on if the failure is retriable.\n\t */\n\treadonly retryOnFailure?: boolean;\n}\n\n/**\n * Options to use when enqueueing a summarize attempt.\n * @legacy @beta\n */\nexport interface IEnqueueSummarizeOptions extends IOnDemandSummarizeOptions {\n\t/**\n\t * If specified, The summarize attempt will not occur until after this sequence number.\n\t */\n\treadonly afterSequenceNumber?: number;\n\n\t/**\n\t * True to override the existing enqueued summarize attempt if there is one.\n\t * This will guarantee that this attempt gets enqueued. If override is false,\n\t * than an existing enqueued summarize attempt will block a new one from being\n\t * enqueued. There can only be one enqueued at a time. Defaults to false.\n\t */\n\treadonly override?: boolean;\n}\n\n/**\n * In addition to the normal summary tree + stats, this contains additional stats\n * only relevant at the root of the tree.\n * @legacy @beta\n */\nexport interface IGeneratedSummaryStats extends ISummaryStats {\n\t/**\n\t * The total number of data stores in the container.\n\t */\n\treadonly dataStoreCount: number;\n\t/**\n\t * The number of data stores that were summarized in this summary.\n\t */\n\treadonly summarizedDataStoreCount: number;\n\t/**\n\t * The number of data stores whose GC reference state was updated in this summary.\n\t */\n\treadonly gcStateUpdatedDataStoreCount?: number;\n\t/**\n\t * The size of the gc blobs in this summary.\n\t */\n\treadonly gcTotalBlobsSize?: number;\n\t/**\n\t * The number of gc blobs in this summary.\n\t */\n\treadonly gcBlobNodeCount?: number;\n\t/**\n\t * The summary number for a container's summary. Incremented on summaries throughout its lifetime.\n\t */\n\treadonly summaryNumber: number;\n}\n\n/**\n * Type for summarization failures that are retriable.\n * @legacy @beta\n */\nexport interface IRetriableFailureError extends Error {\n\treadonly retryAfterSeconds?: number;\n}\n\n/**\n * Base results for all submitSummary attempts.\n * @legacy @beta\n */\nexport interface IBaseSummarizeResult {\n\treadonly stage: \"base\";\n\t/**\n\t * Retriable error object related to failed summarize attempt.\n\t */\n\treadonly error: IRetriableFailureError | undefined;\n\t/**\n\t * Reference sequence number as of the generate summary attempt.\n\t */\n\treadonly referenceSequenceNumber: number;\n\treadonly minimumSequenceNumber: number;\n}\n\n/**\n * Results of submitSummary after generating the summary tree.\n * @legacy @beta\n */\nexport interface IGenerateSummaryTreeResult extends Omit<IBaseSummarizeResult, \"stage\"> {\n\treadonly stage: \"generate\";\n\t/**\n\t * Generated summary tree.\n\t */\n\treadonly summaryTree: ISummaryTree;\n\t/**\n\t * Stats for generated summary tree.\n\t */\n\treadonly summaryStats: IGeneratedSummaryStats;\n\t/**\n\t * Time it took to generate the summary tree and stats.\n\t */\n\treadonly generateDuration: number;\n}\n\n/**\n * Results of submitSummary after uploading the tree to storage.\n * @legacy @beta\n */\nexport interface IUploadSummaryResult extends Omit<IGenerateSummaryTreeResult, \"stage\"> {\n\treadonly stage: \"upload\";\n\t/**\n\t * The handle returned by storage pointing to the uploaded summary tree.\n\t */\n\treadonly handle: string;\n\t/**\n\t * Time it took to upload the summary tree to storage.\n\t */\n\treadonly uploadDuration: number;\n}\n\n/**\n * Results of submitSummary after submitting the summarize op.\n * @legacy @beta\n */\nexport interface ISubmitSummaryOpResult extends Omit<IUploadSummaryResult, \"stage\" | \"error\"> {\n\treadonly stage: \"submit\";\n\t/**\n\t * The client sequence number of the summarize op submitted for the summary.\n\t */\n\treadonly clientSequenceNumber: number;\n\t/**\n\t * Time it took to submit the summarize op to the broadcasting service.\n\t */\n\treadonly submitOpDuration: number;\n}\n\n/**\n * Strict type representing result of a submitSummary attempt.\n * The result consists of 4 possible stages, each with its own data.\n * The data is cumulative, so each stage will contain the data from the previous stages.\n * If the final \"submitted\" stage is not reached, the result may contain the error object.\n *\n * Stages:\n *\n * 1. \"base\" - stopped before the summary tree was even generated, and the result only contains the base data\n *\n * 2. \"generate\" - the summary tree was generated, and the result will contain that tree + stats\n *\n * 3. \"upload\" - the summary was uploaded to storage, and the result contains the server-provided handle\n *\n * 4. \"submit\" - the summarize op was submitted, and the result contains the op client sequence number.\n * @legacy @beta\n */\nexport type SubmitSummaryResult =\n\t| IBaseSummarizeResult\n\t| IGenerateSummaryTreeResult\n\t| IUploadSummaryResult\n\t| ISubmitSummaryOpResult;\n\n/**\n * The stages of Summarize, used to describe how far progress succeeded in case of a failure at a later stage.\n * @legacy @beta\n */\nexport type SummaryStage = SubmitSummaryResult[\"stage\"] | \"unknown\";\n\n/**\n * The data in summarizer result when submit summary stage fails.\n * @legacy @beta\n */\nexport interface SubmitSummaryFailureData {\n\tstage: SummaryStage;\n}\n\n/**\n * @legacy @beta\n */\nexport type SummarizeResultPart<TSuccess, TFailure = undefined> =\n\t| {\n\t\t\tsuccess: true;\n\t\t\tdata: TSuccess;\n\t }\n\t| {\n\t\t\tsuccess: false;\n\t\t\tdata: TFailure | undefined;\n\t\t\tmessage: string;\n\t\t\terror: IRetriableFailureError;\n\t };\n\n/**\n * @legacy @beta\n */\nexport interface ISummarizer extends IEventProvider<ISummarizerEvents> {\n\t/**\n\t * Allows {@link ISummarizer} to be used with our {@link @fluidframework/core-interfaces#FluidObject} pattern.\n\t */\n\treadonly ISummarizer?: ISummarizer;\n\n\t/*\n\t * Asks summarizer to move to exit.\n\t * Summarizer will finish current processes, which may take a while.\n\t * For example, summarizer may complete last summary before exiting.\n\t */\n\tstop(reason: SummarizerStopReason): void;\n\n\t/* Closes summarizer. Any pending processes (summary in flight) are abandoned. */\n\tclose(): void;\n\n\trun(onBehalfOf: string): Promise<SummarizerStopReason>;\n\n\t/**\n\t * Attempts to generate a summary on demand. If already running, takes no action.\n\t * @param options - options controlling the summarize attempt\n\t * @returns an alreadyRunning promise if a summarize attempt is already in progress,\n\t * which will resolve when the current attempt completes. At that point caller can\n\t * decide to try again or not. Otherwise, it will return an object containing promises\n\t * that resolve as the summarize attempt progresses. They will resolve with success\n\t * false if a failure is encountered.\n\t */\n\tsummarizeOnDemand(options: IOnDemandSummarizeOptions): ISummarizeResults;\n\t/**\n\t * Enqueue an attempt to summarize after the specified sequence number.\n\t * If afterSequenceNumber is provided, the summarize attempt is \"enqueued\"\n\t * to run once an eligible op comes in with sequenceNumber \\>= afterSequenceNumber.\n\t * @param options - options controlling the summarize attempt\n\t * @returns an object containing an alreadyEnqueued flag to indicate if another\n\t * summarize attempt has already been enqueued. It also may contain an overridden flag\n\t * when alreadyEnqueued is true, that indicates whether this attempt forced the\n\t * previous attempt to abort. If this attempt becomes enqueued, it returns an object\n\t * containing promises that resolve as the summarize attempt progresses. They will\n\t * resolve with success false if a failure is encountered.\n\t */\n\tenqueueSummarize(options: IEnqueueSummarizeOptions): EnqueueSummarizeResult;\n}\n\n/**\n * Data about an attempt to summarize used for heuristics.\n */\nexport interface ISummarizeAttempt {\n\t/**\n\t * Reference sequence number when summary was generated or attempted\n\t */\n\treadonly refSequenceNumber: number;\n\n\t/**\n\t * Time of summary attempt after it was sent or attempted\n\t */\n\treadonly summaryTime: number;\n\n\t/**\n\t * Sequence number of summary op\n\t */\n\tsummarySequenceNumber?: number;\n}\n\n/**\n * Data relevant for summary heuristics.\n */\nexport interface ISummarizeHeuristicData {\n\t/**\n\t * Latest received op sequence number\n\t */\n\tlastOpSequenceNumber: number;\n\n\t/**\n\t * Most recent summary attempt from this client\n\t */\n\treadonly lastAttempt: ISummarizeAttempt;\n\n\t/**\n\t * Most recent summary that received an ack\n\t */\n\treadonly lastSuccessfulSummary: Readonly<ISummarizeAttempt>;\n\n\t/**\n\t * Number of runtime ops since last summary\n\t */\n\tnumRuntimeOps: number;\n\n\t/**\n\t * Number of non-runtime ops since last summary\n\t */\n\tnumNonRuntimeOps: number;\n\n\t/**\n\t * Cumulative size in bytes of all the ops since the last summary\n\t */\n\ttotalOpsSize: number;\n\n\t/**\n\t * Wether or not this instance contains adjusted metrics due to missing op data\n\t */\n\thasMissingOpData: boolean;\n\n\t/**\n\t * Updates lastAttempt and lastSuccessfulAttempt based on the last summary.\n\t * @param lastSummary - last ack summary\n\t */\n\tupdateWithLastSummaryAckInfo(lastSummary: ISummarizeAttempt): void;\n\n\t/**\n\t * Records a summary attempt. If the attempt was successfully sent,\n\t * provide the reference sequence number, otherwise it will be set\n\t * to the last seen op sequence number.\n\t * @param referenceSequenceNumber - reference sequence number of sent summary\n\t */\n\trecordAttempt(referenceSequenceNumber?: number): void;\n\n\t/**\n\t * Mark that the last sent summary attempt has received an ack\n\t */\n\tmarkLastAttemptAsSuccessful(): void;\n\n\topsSinceLastSummary: number;\n}\n\n/**\n * Responsible for running heuristics determining when to summarize.\n */\nexport interface ISummarizeHeuristicRunner {\n\t/**\n\t * Start specific heuristic trackers (ex: idle timer)\n\t */\n\tstart(): void;\n\n\t/**\n\t * Runs the heuristics to determine if it should try to summarize\n\t */\n\trun(): void;\n\n\t/**\n\t * Runs a different heuristic to check if it should summarize before closing\n\t */\n\tshouldRunLastSummary(): boolean;\n\n\t/**\n\t * Disposes of resources\n\t */\n\tdispose(): void;\n}\n\ntype ISummarizeTelemetryRequiredProperties =\n\t/**\n\t * Reason code for attempting to summarize\n\t */\n\t\"summarizeReason\";\n\ntype ISummarizeTelemetryOptionalProperties =\n\t/**\n\t * Number of attempts within the last time window, used for calculating the throttle delay.\n\t */\n\t| \"summaryAttempts\"\n\t/**\n\t * Summarization may be attempted multiple times. This tells whether this is the final summarization attempt\n\t */\n\t| \"finalAttempt\"\n\t| keyof ISummarizeOptions;\n\nexport type ISummarizeTelemetryProperties = Pick<\n\tITelemetryBaseProperties,\n\tISummarizeTelemetryRequiredProperties\n> &\n\tPartial<Pick<ITelemetryBaseProperties, ISummarizeTelemetryOptionalProperties>>;\n\n/**\n * Strategy used to heuristically determine when we should run a summary\n */\nexport interface ISummaryHeuristicStrategy {\n\t/**\n\t * Summarize reason for this summarize heuristic strategy (ex: \"maxTime\")\n\t */\n\tsummarizeReason: Readonly<SummarizeReason>;\n\n\t/**\n\t * Determines if this strategy's summarize criteria been met\n\t * @param configuration - summary configuration we are to check against\n\t * @param heuristicData - heuristic data used to confirm conditions are met\n\t */\n\tshouldRunSummary(\n\t\tconfiguration: ISummaryConfigurationHeuristics,\n\t\theuristicData: ISummarizeHeuristicData,\n\t): boolean;\n}\n\ntype SummaryGeneratorRequiredTelemetryProperties =\n\t/**\n\t * True to generate the full tree with no handle reuse optimizations\n\t */\n\t| \"fullTree\"\n\t/**\n\t * Time since we last attempted to generate a summary\n\t */\n\t| \"timeSinceLastAttempt\"\n\t/**\n\t * Time since we last successfully generated a summary\n\t */\n\t| \"timeSinceLastSummary\";\n\ntype SummaryGeneratorOptionalTelemetryProperties =\n\t/**\n\t * Reference sequence number as of the generate summary attempt.\n\t */\n\t| \"referenceSequenceNumber\"\n\t/**\n\t * minimum sequence number (at the reference sequence number)\n\t */\n\t| \"minimumSequenceNumber\"\n\t/**\n\t * Delta between the current reference sequence number and the reference sequence number of the last attempt\n\t */\n\t| \"opsSinceLastAttempt\"\n\t/**\n\t * Delta between the current reference sequence number and the reference sequence number of the last summary\n\t */\n\t| \"opsSinceLastSummary\"\n\t/**\n\t * Delta in sum of op sizes between the current reference sequence number and the reference\n\t * sequence number of the last summary\n\t */\n\t| \"opsSizesSinceLastSummary\"\n\t/**\n\t * Delta between the number of non-runtime ops since the last summary\n\t */\n\t| \"nonRuntimeOpsSinceLastSummary\"\n\t/**\n\t * Delta between the number of runtime ops since the last summary\n\t */\n\t| \"runtimeOpsSinceLastSummary\"\n\t/**\n\t * Wether or not this instance contains adjusted metrics due to missing op data\n\t */\n\t| \"hasMissingOpData\"\n\t/**\n\t * Time it took to generate the summary tree and stats.\n\t */\n\t| \"generateDuration\"\n\t/**\n\t * The handle returned by storage pointing to the uploaded summary tree.\n\t */\n\t| \"handle\"\n\t/**\n\t * Time it took to upload the summary tree to storage.\n\t */\n\t| \"uploadDuration\"\n\t/**\n\t * The client sequence number of the summarize op submitted for the summary.\n\t */\n\t| \"clientSequenceNumber\"\n\t/**\n\t * Time it took for this summary to be acked after it was generated\n\t */\n\t| \"ackWaitDuration\"\n\t/**\n\t * Reference sequence number of the ack/nack message\n\t */\n\t| \"ackNackSequenceNumber\"\n\t/**\n\t * Actual sequence number of the summary op proposal.\n\t */\n\t| \"summarySequenceNumber\"\n\t/**\n\t * Optional Retry-After time in seconds. If specified, the client should wait this many seconds before retrying.\n\t */\n\t| \"nackRetryAfter\"\n\t/**\n\t * The stage at which the submit summary method failed at. This can help determine what type of failure we have\n\t */\n\t| \"stage\";\n\nexport type SummaryGeneratorTelemetry = Pick<\n\tITelemetryBaseProperties,\n\tSummaryGeneratorRequiredTelemetryProperties\n> &\n\tPartial<Pick<ITelemetryBaseProperties, SummaryGeneratorOptionalTelemetryProperties>>;\n\nexport interface ISummarizeRunnerTelemetry extends ITelemetryLoggerPropertyBag {\n\t/**\n\t * Number of times the summarizer run.\n\t */\n\tsummarizeCount: () => number;\n\t/**\n\t * Number of successful attempts to summarize.\n\t */\n\tsummarizerSuccessfulAttempts: () => number;\n}\n\n/**\n * @legacy @beta\n */\nexport interface ISummaryBaseConfiguration {\n\t/**\n\t * Delay before first attempt to spawn summarizing container.\n\t */\n\tinitialSummarizerDelayMs: number;\n\n\t/**\n\t * Defines the maximum allowed time to wait for a pending summary ack.\n\t * The maximum amount of time client will wait for a summarize is the minimum of\n\t * maxSummarizeAckWaitTime (currently 3 * 60 * 1000) and maxAckWaitTime.\n\t */\n\tmaxAckWaitTime: number;\n\t/**\n\t * Defines the maximum number of Ops in between Summaries that can be\n\t * allowed before forcibly electing a new summarizer client.\n\t */\n\tmaxOpsSinceLastSummary: number;\n}\n\n/**\n * @legacy @beta\n */\nexport interface ISummaryConfigurationHeuristics extends ISummaryBaseConfiguration {\n\tstate: \"enabled\";\n\t/**\n\t * Defines the maximum allowed time, since the last received Ack, before running the summary\n\t * with reason maxTime.\n\t * For example, say we receive ops one by one just before the idle time is triggered.\n\t * In this case, we still want to run a summary since it's been a while since the last summary.\n\t */\n\tmaxTime: number;\n\t/**\n\t * Defines the maximum number of Ops, since the last received Ack, that can be allowed\n\t * before running the summary with reason maxOps.\n\t */\n\tmaxOps: number;\n\t/**\n\t * Defines the minimum number of Ops, since the last received Ack, that can be allowed\n\t * before running the last summary.\n\t */\n\tminOpsForLastSummaryAttempt: number;\n\t/**\n\t * Defines the lower boundary for the allowed time in between summarizations.\n\t * Pairs with maxIdleTime to form a range.\n\t * For example, if we only receive 1 op, we don't want to have the same idle time as say 100 ops.\n\t * Based on the boundaries we set in minIdleTime and maxIdleTime, the idle time will change\n\t * linearly depending on the number of ops we receive.\n\t */\n\tminIdleTime: number;\n\t/**\n\t * Defines the upper boundary for the allowed time in between summarizations.\n\t * Pairs with minIdleTime to form a range.\n\t * For example, if we only receive 1 op, we don't want to have the same idle time as say 100 ops.\n\t * Based on the boundaries we set in minIdleTime and maxIdleTime, the idle time will change\n\t * linearly depending on the number of ops we receive.\n\t */\n\tmaxIdleTime: number;\n\t/**\n\t * Runtime op weight to use in heuristic summarizing.\n\t * This number is a multiplier on the number of runtime ops we process when running summarize heuristics.\n\t * For example: (multiplier) * (number of runtime ops) = weighted number of runtime ops\n\t */\n\truntimeOpWeight: number;\n\t/**\n\t * Non-runtime op weight to use in heuristic summarizing\n\t * This number is a multiplier on the number of non-runtime ops we process when running summarize heuristics.\n\t * For example: (multiplier) * (number of non-runtime ops) = weighted number of non-runtime ops\n\t */\n\tnonRuntimeOpWeight: number;\n\n\t/**\n\t * Number of ops since last summary needed before a non-runtime op can trigger running summary heuristics.\n\t *\n\t * Note: Any runtime ops sent before the threshold is reached will trigger heuristics normally.\n\t * This threshold ONLY applies to non-runtime ops triggering summaries.\n\t *\n\t * For example: Say the threshold is 20. Sending 19 non-runtime ops will not trigger any heuristic checks.\n\t * Sending the 20th non-runtime op will trigger the heuristic checks for summarizing.\n\t */\n\tnonRuntimeHeuristicThreshold?: number;\n}\n\n/**\n * @legacy @beta\n */\nexport interface ISummaryConfigurationDisableSummarizer {\n\tstate: \"disabled\";\n}\n\n/**\n * @legacy @beta\n */\nexport interface ISummaryConfigurationDisableHeuristics extends ISummaryBaseConfiguration {\n\tstate: \"disableHeuristics\";\n}\n\n/**\n * Configuration used internally to indicate on-demand summaries only (no election/heuristics).\n * @legacy @beta\n */\nexport interface ISummaryConfigurationWithSummaryOnRequest extends ISummaryBaseConfiguration {\n\tstate: \"summaryOnRequest\";\n}\n\n/**\n * @legacy @beta\n */\nexport type ISummaryConfiguration =\n\t| ISummaryConfigurationDisableSummarizer\n\t| ISummaryConfigurationDisableHeuristics\n\t| ISummaryConfigurationHeuristics\n\t| ISummaryConfigurationWithSummaryOnRequest;\n"]}
1
+ {"version":3,"file":"summarizerTypes.js","sourceRoot":"","sources":["../../src/summary/summarizerTypes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAiCH,MAAM,CAAC,MAAM,oBAAoB,GAAG,YAAY,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type {\n\tIDeltaManager,\n\tContainerWarning,\n} from \"@fluidframework/container-definitions/internal\";\nimport type {\n\tISummarizerEvents,\n\tSummarizerStopReason,\n} from \"@fluidframework/container-runtime-definitions/internal\";\nimport type {\n\tIEventProvider,\n\tITelemetryBaseProperties,\n\tITelemetryBaseLogger,\n} from \"@fluidframework/core-interfaces\";\nimport type { ISummaryTree } from \"@fluidframework/driver-definitions\";\nimport type {\n\tIDocumentMessage,\n\tISequencedDocumentMessage,\n} from \"@fluidframework/driver-definitions/internal\";\nimport type { ISummaryStats } from \"@fluidframework/runtime-definitions/internal\";\nimport type { TelemetryContext } from \"@fluidframework/runtime-utils/internal\";\nimport type {\n\tITelemetryLoggerExt,\n\tITelemetryLoggerPropertyBag,\n} from \"@fluidframework/telemetry-utils/internal\";\n\nimport type { SummarizeReason } from \"./summarizerUtils.js\";\nimport type {\n\tEnqueueSummarizeResult,\n\tISummarizeResults,\n} from \"./summaryDelayLoadedModule/index.js\";\n\nexport const summarizerClientType = \"summarizer\";\n\n/**\n * Similar to AbortSignal, but using promise instead of events\n * @param T - cancellation reason type\n * @internal\n */\nexport interface ICancellationToken<T> {\n\t/**\n\t * Tells if this cancellable token is cancelled\n\t */\n\treadonly cancelled: boolean;\n\t/**\n\t * Promise that gets fulfilled when this cancellable token is cancelled\n\t * @returns reason of cancellation\n\t */\n\treadonly waitCancelled: Promise<T>;\n}\n\n/**\n * Similar to AbortSignal, but using promise instead of events\n * @internal\n */\nexport type ISummaryCancellationToken = ICancellationToken<SummarizerStopReason>;\n\n/**\n * Data required to update internal tracking state after receiving a Summary Ack.\n * @internal\n */\nexport interface IRefreshSummaryAckOptions {\n\t/**\n\t * Handle from the ack's summary op.\n\t */\n\treadonly proposalHandle: string | undefined;\n\t/**\n\t * Handle from the summary ack just received\n\t */\n\treadonly ackHandle: string;\n\t/**\n\t * Reference sequence number from the ack's summary op\n\t */\n\treadonly summaryRefSeq: number;\n\t/**\n\t * Telemetry logger to which telemetry events will be forwarded.\n\t */\n\treadonly summaryLogger: ITelemetryLoggerExt;\n}\n\n/**\n * @internal\n */\nexport interface ISummarizerInternalsProvider {\n\t/**\n\t * Encapsulates the work to walk the internals of the running container to generate a summary\n\t */\n\tsubmitSummary(options: ISubmitSummaryOptions): Promise<SubmitSummaryResult>;\n\n\t/**\n\t * Callback whenever a new SummaryAck is received, to update internal tracking state\n\t */\n\trefreshLatestSummaryAck(options: IRefreshSummaryAckOptions): Promise<void>;\n}\n\n/**\n * @internal\n */\nexport interface ISummarizingWarning extends ContainerWarning {\n\treadonly errorType: \"summarizingError\";\n\treadonly logged: boolean;\n}\n\n/**\n * @internal\n */\nexport interface IConnectableRuntime {\n\treadonly disposed: boolean;\n\treadonly connected: boolean;\n\treadonly clientId: string | undefined;\n\tonce(event: \"connected\" | \"disconnected\" | \"dispose\", listener: () => void): this;\n}\n\n/**\n * @internal\n */\nexport interface ISummarizerRuntime extends IConnectableRuntime {\n\treadonly baseLogger: ITelemetryBaseLogger;\n\t/**\n\t * clientId of parent (non-summarizing) container that owns summarizer container\n\t */\n\treadonly summarizerClientId: string | undefined;\n\treadonly deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>;\n\tdisposeFn(): void;\n\tcloseFn(): void;\n\ton(\n\t\tevent: \"op\",\n\t\tlistener: (op: ISequencedDocumentMessage, runtimeMessage?: boolean) => void,\n\t): this;\n\toff(\n\t\tevent: \"op\",\n\t\tlistener: (op: ISequencedDocumentMessage, runtimeMessage?: boolean) => void,\n\t): this;\n}\n\n/**\n * Options affecting summarize behavior.\n * @legacy @beta\n */\nexport interface ISummarizeOptions {\n\t/**\n\t * True to generate the full tree with no handle reuse optimizations; defaults to false\n\t */\n\treadonly fullTree?: boolean;\n}\n\n/**\n * @internal\n */\nexport interface ISubmitSummaryOptions extends ISummarizeOptions {\n\t/**\n\t * Logger to use for correlated summary events\n\t */\n\treadonly summaryLogger: ITelemetryLoggerExt;\n\t/**\n\t * Tells when summary process should be cancelled\n\t */\n\treadonly cancellationToken: ISummaryCancellationToken;\n\t/**\n\t * Summarization may be attempted multiple times. This tells whether this is the final summarization attempt.\n\t */\n\treadonly finalAttempt?: boolean;\n\t/**\n\t * The sequence number of the latest summary used to validate if summary state is correct before summarizing\n\t */\n\treadonly latestSummaryRefSeqNum: number;\n\t/**\n\t * Shared telemetry context for the current summarize attempt.\n\t */\n\ttelemetryContext?: TelemetryContext;\n}\n\n/**\n * @legacy @beta\n */\nexport interface IOnDemandSummarizeOptions extends ISummarizeOptions {\n\t/**\n\t * Reason for generating summary.\n\t */\n\treadonly reason: string;\n\t/**\n\t * In case of a failure, will attempt to retry based on if the failure is retriable.\n\t */\n\treadonly retryOnFailure?: boolean;\n}\n\n/**\n * Options to use when enqueueing a summarize attempt.\n * @legacy @beta\n */\nexport interface IEnqueueSummarizeOptions extends IOnDemandSummarizeOptions {\n\t/**\n\t * If specified, The summarize attempt will not occur until after this sequence number.\n\t */\n\treadonly afterSequenceNumber?: number;\n\n\t/**\n\t * True to override the existing enqueued summarize attempt if there is one.\n\t * This will guarantee that this attempt gets enqueued. If override is false,\n\t * than an existing enqueued summarize attempt will block a new one from being\n\t * enqueued. There can only be one enqueued at a time. Defaults to false.\n\t */\n\treadonly override?: boolean;\n}\n\n/**\n * In addition to the normal summary tree + stats, this contains additional stats\n * only relevant at the root of the tree.\n * @legacy @beta\n */\nexport interface IGeneratedSummaryStats extends ISummaryStats {\n\t/**\n\t * The total number of data stores in the container.\n\t */\n\treadonly dataStoreCount: number;\n\t/**\n\t * The number of data stores that were summarized in this summary.\n\t */\n\treadonly summarizedDataStoreCount: number;\n\t/**\n\t * The number of data stores whose GC reference state was updated in this summary.\n\t */\n\treadonly gcStateUpdatedDataStoreCount?: number;\n\t/**\n\t * The size of the gc blobs in this summary.\n\t */\n\treadonly gcTotalBlobsSize?: number;\n\t/**\n\t * The number of gc blobs in this summary.\n\t */\n\treadonly gcBlobNodeCount?: number;\n\t/**\n\t * The summary number for a container's summary. Incremented on summaries throughout its lifetime.\n\t */\n\treadonly summaryNumber: number;\n}\n\n/**\n * Type for summarization failures that are retriable.\n * @legacy @beta\n */\nexport interface IRetriableFailureError extends Error {\n\treadonly retryAfterSeconds?: number;\n}\n\n/**\n * Base results for all submitSummary attempts.\n * @legacy @beta\n */\nexport interface IBaseSummarizeResult {\n\treadonly stage: \"base\";\n\t/**\n\t * Retriable error object related to failed summarize attempt.\n\t */\n\treadonly error: IRetriableFailureError | undefined;\n\t/**\n\t * Reference sequence number as of the generate summary attempt.\n\t */\n\treadonly referenceSequenceNumber: number;\n\treadonly minimumSequenceNumber: number;\n}\n\n/**\n * Results of submitSummary after generating the summary tree.\n * @legacy @beta\n */\nexport interface IGenerateSummaryTreeResult extends Omit<IBaseSummarizeResult, \"stage\"> {\n\treadonly stage: \"generate\";\n\t/**\n\t * Generated summary tree.\n\t */\n\treadonly summaryTree: ISummaryTree;\n\t/**\n\t * Stats for generated summary tree.\n\t */\n\treadonly summaryStats: IGeneratedSummaryStats;\n\t/**\n\t * Time it took to generate the summary tree and stats.\n\t */\n\treadonly generateDuration: number;\n}\n\n/**\n * Results of submitSummary after uploading the tree to storage.\n * @legacy @beta\n */\nexport interface IUploadSummaryResult extends Omit<IGenerateSummaryTreeResult, \"stage\"> {\n\treadonly stage: \"upload\";\n\t/**\n\t * The handle returned by storage pointing to the uploaded summary tree.\n\t */\n\treadonly handle: string;\n\t/**\n\t * Time it took to upload the summary tree to storage.\n\t */\n\treadonly uploadDuration: number;\n}\n\n/**\n * Results of submitSummary after submitting the summarize op.\n * @legacy @beta\n */\nexport interface ISubmitSummaryOpResult extends Omit<IUploadSummaryResult, \"stage\" | \"error\"> {\n\treadonly stage: \"submit\";\n\t/**\n\t * The client sequence number of the summarize op submitted for the summary.\n\t */\n\treadonly clientSequenceNumber: number;\n\t/**\n\t * Time it took to submit the summarize op to the broadcasting service.\n\t */\n\treadonly submitOpDuration: number;\n}\n\n/**\n * Strict type representing result of a submitSummary attempt.\n * The result consists of 4 possible stages, each with its own data.\n * The data is cumulative, so each stage will contain the data from the previous stages.\n * If the final \"submitted\" stage is not reached, the result may contain the error object.\n *\n * Stages:\n *\n * 1. \"base\" - stopped before the summary tree was even generated, and the result only contains the base data\n *\n * 2. \"generate\" - the summary tree was generated, and the result will contain that tree + stats\n *\n * 3. \"upload\" - the summary was uploaded to storage, and the result contains the server-provided handle\n *\n * 4. \"submit\" - the summarize op was submitted, and the result contains the op client sequence number.\n * @legacy @beta\n */\nexport type SubmitSummaryResult =\n\t| IBaseSummarizeResult\n\t| IGenerateSummaryTreeResult\n\t| IUploadSummaryResult\n\t| ISubmitSummaryOpResult;\n\n/**\n * The stages of Summarize, used to describe how far progress succeeded in case of a failure at a later stage.\n * @legacy @beta\n */\nexport type SummaryStage = SubmitSummaryResult[\"stage\"] | \"unknown\";\n\n/**\n * The data in summarizer result when submit summary stage fails.\n * @legacy @beta\n */\nexport interface SubmitSummaryFailureData {\n\tstage: SummaryStage;\n}\n\n/**\n * @legacy @beta\n */\nexport type SummarizeResultPart<TSuccess, TFailure = undefined> =\n\t| {\n\t\t\tsuccess: true;\n\t\t\tdata: TSuccess;\n\t }\n\t| {\n\t\t\tsuccess: false;\n\t\t\tdata: TFailure | undefined;\n\t\t\tmessage: string;\n\t\t\terror: IRetriableFailureError;\n\t };\n\n/**\n * @legacy @beta\n */\nexport interface ISummarizer extends IEventProvider<ISummarizerEvents> {\n\t/**\n\t * Allows {@link ISummarizer} to be used with our {@link @fluidframework/core-interfaces#FluidObject} pattern.\n\t */\n\treadonly ISummarizer?: ISummarizer;\n\n\t/*\n\t * Asks summarizer to move to exit.\n\t * Summarizer will finish current processes, which may take a while.\n\t * For example, summarizer may complete last summary before exiting.\n\t */\n\tstop(reason: SummarizerStopReason): void;\n\n\t/* Closes summarizer. Any pending processes (summary in flight) are abandoned. */\n\tclose(): void;\n\n\trun(onBehalfOf: string): Promise<SummarizerStopReason>;\n\n\t/**\n\t * Attempts to generate a summary on demand. If already running, takes no action.\n\t * @param options - options controlling the summarize attempt\n\t * @returns an alreadyRunning promise if a summarize attempt is already in progress,\n\t * which will resolve when the current attempt completes. At that point caller can\n\t * decide to try again or not. Otherwise, it will return an object containing promises\n\t * that resolve as the summarize attempt progresses. They will resolve with success\n\t * false if a failure is encountered.\n\t */\n\tsummarizeOnDemand(options: IOnDemandSummarizeOptions): ISummarizeResults;\n\t/**\n\t * Enqueue an attempt to summarize after the specified sequence number.\n\t * If afterSequenceNumber is provided, the summarize attempt is \"enqueued\"\n\t * to run once an eligible op comes in with sequenceNumber \\>= afterSequenceNumber.\n\t * @param options - options controlling the summarize attempt\n\t * @returns an object containing an alreadyEnqueued flag to indicate if another\n\t * summarize attempt has already been enqueued. It also may contain an overridden flag\n\t * when alreadyEnqueued is true, that indicates whether this attempt forced the\n\t * previous attempt to abort. If this attempt becomes enqueued, it returns an object\n\t * containing promises that resolve as the summarize attempt progresses. They will\n\t * resolve with success false if a failure is encountered.\n\t */\n\tenqueueSummarize(options: IEnqueueSummarizeOptions): EnqueueSummarizeResult;\n}\n\n/**\n * Data about an attempt to summarize used for heuristics.\n */\nexport interface ISummarizeAttempt {\n\t/**\n\t * Reference sequence number when summary was generated or attempted\n\t */\n\treadonly refSequenceNumber: number;\n\n\t/**\n\t * Time of summary attempt after it was sent or attempted\n\t */\n\treadonly summaryTime: number;\n\n\t/**\n\t * Sequence number of summary op\n\t */\n\tsummarySequenceNumber?: number;\n}\n\n/**\n * Data relevant for summary heuristics.\n */\nexport interface ISummarizeHeuristicData {\n\t/**\n\t * Latest received op sequence number\n\t */\n\tlastOpSequenceNumber: number;\n\n\t/**\n\t * Most recent summary attempt from this client\n\t */\n\treadonly lastAttempt: ISummarizeAttempt;\n\n\t/**\n\t * Most recent summary that received an ack\n\t */\n\treadonly lastSuccessfulSummary: Readonly<ISummarizeAttempt>;\n\n\t/**\n\t * Number of runtime ops since last summary\n\t */\n\tnumRuntimeOps: number;\n\n\t/**\n\t * Number of non-runtime ops since last summary\n\t */\n\tnumNonRuntimeOps: number;\n\n\t/**\n\t * Cumulative size in bytes of all the ops since the last summary\n\t */\n\ttotalOpsSize: number;\n\n\t/**\n\t * Wether or not this instance contains adjusted metrics due to missing op data\n\t */\n\thasMissingOpData: boolean;\n\n\t/**\n\t * Updates lastAttempt and lastSuccessfulAttempt based on the last summary.\n\t * @param lastSummary - last ack summary\n\t */\n\tupdateWithLastSummaryAckInfo(lastSummary: ISummarizeAttempt): void;\n\n\t/**\n\t * Records a summary attempt. If the attempt was successfully sent,\n\t * provide the reference sequence number, otherwise it will be set\n\t * to the last seen op sequence number.\n\t * @param referenceSequenceNumber - reference sequence number of sent summary\n\t */\n\trecordAttempt(referenceSequenceNumber?: number): void;\n\n\t/**\n\t * Mark that the last sent summary attempt has received an ack\n\t */\n\tmarkLastAttemptAsSuccessful(): void;\n\n\topsSinceLastSummary: number;\n}\n\n/**\n * Responsible for running heuristics determining when to summarize.\n */\nexport interface ISummarizeHeuristicRunner {\n\t/**\n\t * Start specific heuristic trackers (ex: idle timer)\n\t */\n\tstart(): void;\n\n\t/**\n\t * Runs the heuristics to determine if it should try to summarize\n\t */\n\trun(): void;\n\n\t/**\n\t * Runs a different heuristic to check if it should summarize before closing\n\t */\n\tshouldRunLastSummary(): boolean;\n\n\t/**\n\t * Disposes of resources\n\t */\n\tdispose(): void;\n}\n\ntype ISummarizeTelemetryRequiredProperties =\n\t/**\n\t * Reason code for attempting to summarize\n\t */\n\t\"summarizeReason\";\n\ntype ISummarizeTelemetryOptionalProperties =\n\t/**\n\t * Number of attempts within the last time window, used for calculating the throttle delay.\n\t */\n\t| \"summaryAttempts\"\n\t/**\n\t * Summarization may be attempted multiple times. This tells whether this is the final summarization attempt\n\t */\n\t| \"finalAttempt\"\n\t| keyof ISummarizeOptions;\n\nexport type ISummarizeTelemetryProperties = Pick<\n\tITelemetryBaseProperties,\n\tISummarizeTelemetryRequiredProperties\n> &\n\tPartial<Pick<ITelemetryBaseProperties, ISummarizeTelemetryOptionalProperties>>;\n\n/**\n * Strategy used to heuristically determine when we should run a summary\n */\nexport interface ISummaryHeuristicStrategy {\n\t/**\n\t * Summarize reason for this summarize heuristic strategy (ex: \"maxTime\")\n\t */\n\tsummarizeReason: Readonly<SummarizeReason>;\n\n\t/**\n\t * Determines if this strategy's summarize criteria been met\n\t * @param configuration - summary configuration we are to check against\n\t * @param heuristicData - heuristic data used to confirm conditions are met\n\t */\n\tshouldRunSummary(\n\t\tconfiguration: ISummaryConfigurationHeuristics,\n\t\theuristicData: ISummarizeHeuristicData,\n\t): boolean;\n}\n\ntype SummaryGeneratorRequiredTelemetryProperties =\n\t/**\n\t * True to generate the full tree with no handle reuse optimizations\n\t */\n\t| \"fullTree\"\n\t/**\n\t * Time since we last attempted to generate a summary\n\t */\n\t| \"timeSinceLastAttempt\"\n\t/**\n\t * Time since we last successfully generated a summary\n\t */\n\t| \"timeSinceLastSummary\";\n\ntype SummaryGeneratorOptionalTelemetryProperties =\n\t/**\n\t * Reference sequence number as of the generate summary attempt.\n\t */\n\t| \"referenceSequenceNumber\"\n\t/**\n\t * minimum sequence number (at the reference sequence number)\n\t */\n\t| \"minimumSequenceNumber\"\n\t/**\n\t * Delta between the current reference sequence number and the reference sequence number of the last attempt\n\t */\n\t| \"opsSinceLastAttempt\"\n\t/**\n\t * Delta between the current reference sequence number and the reference sequence number of the last summary\n\t */\n\t| \"opsSinceLastSummary\"\n\t/**\n\t * Delta in sum of op sizes between the current reference sequence number and the reference\n\t * sequence number of the last summary\n\t */\n\t| \"opsSizesSinceLastSummary\"\n\t/**\n\t * Delta between the number of non-runtime ops since the last summary\n\t */\n\t| \"nonRuntimeOpsSinceLastSummary\"\n\t/**\n\t * Delta between the number of runtime ops since the last summary\n\t */\n\t| \"runtimeOpsSinceLastSummary\"\n\t/**\n\t * Wether or not this instance contains adjusted metrics due to missing op data\n\t */\n\t| \"hasMissingOpData\"\n\t/**\n\t * Time it took to generate the summary tree and stats.\n\t */\n\t| \"generateDuration\"\n\t/**\n\t * The handle returned by storage pointing to the uploaded summary tree.\n\t */\n\t| \"handle\"\n\t/**\n\t * Time it took to upload the summary tree to storage.\n\t */\n\t| \"uploadDuration\"\n\t/**\n\t * The client sequence number of the summarize op submitted for the summary.\n\t */\n\t| \"clientSequenceNumber\"\n\t/**\n\t * Time it took for this summary to be acked after it was generated\n\t */\n\t| \"ackWaitDuration\"\n\t/**\n\t * Reference sequence number of the ack/nack message\n\t */\n\t| \"ackNackSequenceNumber\"\n\t/**\n\t * Actual sequence number of the summary op proposal.\n\t */\n\t| \"summarySequenceNumber\"\n\t/**\n\t * Optional Retry-After time in seconds. If specified, the client should wait this many seconds before retrying.\n\t */\n\t| \"nackRetryAfter\"\n\t/**\n\t * The stage at which the submit summary method failed at. This can help determine what type of failure we have\n\t */\n\t| \"stage\";\n\nexport type SummaryGeneratorTelemetry = Pick<\n\tITelemetryBaseProperties,\n\tSummaryGeneratorRequiredTelemetryProperties\n> &\n\tPartial<Pick<ITelemetryBaseProperties, SummaryGeneratorOptionalTelemetryProperties>>;\n\nexport interface ISummarizeRunnerTelemetry extends ITelemetryLoggerPropertyBag {\n\t/**\n\t * Number of times the summarizer run.\n\t */\n\tsummarizeCount: () => number;\n\t/**\n\t * Number of successful attempts to summarize.\n\t */\n\tsummarizerSuccessfulAttempts: () => number;\n}\n\n/**\n * @legacy @beta\n */\nexport interface ISummaryBaseConfiguration {\n\t/**\n\t * Delay before first attempt to spawn summarizing container.\n\t */\n\tinitialSummarizerDelayMs: number;\n\n\t/**\n\t * Defines the maximum allowed time to wait for a pending summary ack.\n\t * The maximum amount of time client will wait for a summarize is the minimum of\n\t * maxSummarizeAckWaitTime (currently 3 * 60 * 1000) and maxAckWaitTime.\n\t */\n\tmaxAckWaitTime: number;\n\t/**\n\t * Defines the maximum number of Ops in between Summaries that can be\n\t * allowed before forcibly electing a new summarizer client.\n\t */\n\tmaxOpsSinceLastSummary: number;\n}\n\n/**\n * @legacy @beta\n */\nexport interface ISummaryConfigurationHeuristics extends ISummaryBaseConfiguration {\n\tstate: \"enabled\";\n\t/**\n\t * Defines the maximum allowed time, since the last received Ack, before running the summary\n\t * with reason maxTime.\n\t * For example, say we receive ops one by one just before the idle time is triggered.\n\t * In this case, we still want to run a summary since it's been a while since the last summary.\n\t */\n\tmaxTime: number;\n\t/**\n\t * Defines the maximum number of Ops, since the last received Ack, that can be allowed\n\t * before running the summary with reason maxOps.\n\t */\n\tmaxOps: number;\n\t/**\n\t * Defines the minimum number of Ops, since the last received Ack, that can be allowed\n\t * before running the last summary.\n\t */\n\tminOpsForLastSummaryAttempt: number;\n\t/**\n\t * Defines the lower boundary for the allowed time in between summarizations.\n\t * Pairs with maxIdleTime to form a range.\n\t * For example, if we only receive 1 op, we don't want to have the same idle time as say 100 ops.\n\t * Based on the boundaries we set in minIdleTime and maxIdleTime, the idle time will change\n\t * linearly depending on the number of ops we receive.\n\t */\n\tminIdleTime: number;\n\t/**\n\t * Defines the upper boundary for the allowed time in between summarizations.\n\t * Pairs with minIdleTime to form a range.\n\t * For example, if we only receive 1 op, we don't want to have the same idle time as say 100 ops.\n\t * Based on the boundaries we set in minIdleTime and maxIdleTime, the idle time will change\n\t * linearly depending on the number of ops we receive.\n\t */\n\tmaxIdleTime: number;\n\t/**\n\t * Runtime op weight to use in heuristic summarizing.\n\t * This number is a multiplier on the number of runtime ops we process when running summarize heuristics.\n\t * For example: (multiplier) * (number of runtime ops) = weighted number of runtime ops\n\t */\n\truntimeOpWeight: number;\n\t/**\n\t * Non-runtime op weight to use in heuristic summarizing\n\t * This number is a multiplier on the number of non-runtime ops we process when running summarize heuristics.\n\t * For example: (multiplier) * (number of non-runtime ops) = weighted number of non-runtime ops\n\t */\n\tnonRuntimeOpWeight: number;\n\n\t/**\n\t * Number of ops since last summary needed before a non-runtime op can trigger running summary heuristics.\n\t *\n\t * Note: Any runtime ops sent before the threshold is reached will trigger heuristics normally.\n\t * This threshold ONLY applies to non-runtime ops triggering summaries.\n\t *\n\t * For example: Say the threshold is 20. Sending 19 non-runtime ops will not trigger any heuristic checks.\n\t * Sending the 20th non-runtime op will trigger the heuristic checks for summarizing.\n\t */\n\tnonRuntimeHeuristicThreshold?: number;\n}\n\n/**\n * @legacy @beta\n */\nexport interface ISummaryConfigurationDisableSummarizer {\n\tstate: \"disabled\";\n}\n\n/**\n * @legacy @beta\n */\nexport interface ISummaryConfigurationDisableHeuristics extends ISummaryBaseConfiguration {\n\tstate: \"disableHeuristics\";\n}\n\n/**\n * Configuration used internally to indicate on-demand summaries only (no election/heuristics).\n * @legacy @beta\n */\nexport interface ISummaryConfigurationWithSummaryOnRequest extends ISummaryBaseConfiguration {\n\tstate: \"summaryOnRequest\";\n}\n\n/**\n * @legacy @beta\n */\nexport type ISummaryConfiguration =\n\t| ISummaryConfigurationDisableSummarizer\n\t| ISummaryConfigurationDisableHeuristics\n\t| ISummaryConfigurationHeuristics\n\t| ISummaryConfigurationWithSummaryOnRequest;\n"]}
@@ -42,7 +42,6 @@ export declare class RunningSummarizer extends TypedEventEmitter<ISummarizerEven
42
42
  private summarizeCount;
43
43
  private totalSuccessfulAttempts;
44
44
  private initialized;
45
- private readonly runtimeListener;
46
45
  /**
47
46
  * The maximum number of summary attempts to do when submit summary fails.
48
47
  */
@@ -65,6 +64,9 @@ export declare class RunningSummarizer extends TypedEventEmitter<ISummarizerEven
65
64
  */
66
65
  private processIncomingSummaryAcks;
67
66
  dispose(): void;
67
+ private readonly eventsCleanup;
68
+ private setupEventListeners;
69
+ private cleanupEventListeners;
68
70
  /**
69
71
  * RunningSummarizer's logger includes the sequenced index of the current summary on each event.
70
72
  * If some other Summarizer code wants that event on their logs they can get it here,
@@ -1 +1 @@
1
- {"version":3,"file":"runningSummarizer.d.ts","sourceRoot":"","sources":["../../../src/summary/summaryDelayLoadedModule/runningSummarizer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,KAAK,EAEX,iBAAiB,EAEjB,oBAAoB,EACpB,MAAM,wDAAwD,CAAC;AAChE,OAAO,KAAK,EAAE,WAAW,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AAEzF,OAAO,EAGN,KAAK,yBAAyB,EAC9B,MAAM,6CAA6C,CAAC;AACrD,OAAO,EAMN,KAAK,mBAAmB,EACxB,MAAM,0CAA0C,CAAC;AAGlD,OAAO,KAAK,EACX,wBAAwB,EACxB,yBAAyB,EACzB,yBAAyB,EAEzB,qBAAqB,EACrB,uBAAuB,EAGvB,kBAAkB,EAGlB,yBAAyB,EACzB,qBAAqB,EACrB,mBAAmB,EACnB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,KAAK,EAEX,qBAAqB,EACrB,iB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AEX,OAAO;YAoHO,gBAAgB;IAiC9B,OAAO,CAAC,QAAQ,CAAC,qCAAqC,CA2BpD;IAEF;;;;;;;OAOG;YACW,0BAA0B;IAYjC,OAAO,IAAI,IAAI;IAYtB,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAsB;IAEpD,OAAO,CAAC,mBAAmB;IAkB3B,OAAO,CAAC,qBAAqB;IAO7B;;;;;OAKG;IACI,sBAAsB,oBACX,MAAM,KACrB,mBAAmB,GAAG,SAAS,CAGpB;IAEd;;OAEG;IACH,OAAO,CAAC,8BAA8B,CAAS;IAExC,QAAQ,CAAC,EAAE,EAAE,yBAAyB,EAAE,cAAc,EAAE,OAAO,GAAG,IAAI;IA8B7E;;;;;OAKG;IACH,OAAO,CAAC,mBAAmB;IAgB3B,OAAO,CAAC,6BAA6B;IAWxB,QAAQ,CAAC,gBAAgB,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;YAyCjD,SAAS;IAuBvB,OAAO,CAAC,mBAAmB;IAI3B,OAAO,CAAC,kBAAkB;IAW1B;;;;;;;;OAQG;YACW,mBAAmB;IAsBjC;;;;;;;;OAQG;IACH,OAAO,CAAC,gBAAgB;IA+ExB;;OAEG;IACH,OAAO,CAAC,YAAY;IA0BpB;;;OAGG;YACW,uBAAuB;IA6KrC;;;OAGG;YACW,4BAA4B;IAsB1C;;OAEG;IACI,iBAAiB,CACvB,OAAO,EAAE,yBAAyB,EAClC,cAAc,GAAE,sBAAqD,GACnE,iBAAiB;IAkCpB;;OAEG;IACI,gBAAgB,CAAC,OAAO,EAAE,wBAAwB,GAAG,sBAAsB;IAmClF,OAAO,CAAC,qBAAqB;IAwB7B,OAAO,CAAC,sBAAsB;CAS9B"}
@@ -110,6 +110,7 @@ export class RunningSummarizer extends TypedEventEmitter {
110
110
  }, error);
111
111
  });
112
112
  };
113
+ this.eventsCleanup = [];
113
114
  /**
114
115
  * RunningSummarizer's logger includes the sequenced index of the current summary on each event.
115
116
  * If some other Summarizer code wants that event on their logs they can get it here,
@@ -175,11 +176,6 @@ export class RunningSummarizer extends TypedEventEmitter {
175
176
  await this.refreshLatestSummaryAckAndHandleError(options);
176
177
  }
177
178
  }, this.summaryWatcher, this.mc.logger);
178
- // Listen to runtime for ops
179
- this.runtimeListener = (op, runtimeMessage) => {
180
- this.handleOp(op, runtimeMessage === true);
181
- };
182
- this.runtime.on("op", this.runtimeListener);
183
179
  // The max attempts for submit failures can be overridden via a feature flag. This allows us to
184
180
  // tweak this as per telemetry data until we arrive at a stable number.
185
181
  // If its set to a number higher than `defaultMaxAttemptsForSubmitFailures`, it will be ignored.
@@ -189,6 +185,7 @@ export class RunningSummarizer extends TypedEventEmitter {
189
185
  overrideMaxAttempts < defaultMaxAttemptsForSubmitFailures
190
186
  ? overrideMaxAttempts
191
187
  : defaultMaxAttemptsForSubmitFailures;
188
+ this.setupEventListeners();
192
189
  }
193
190
  async handleSummaryAck(ack) {
194
191
  const refSequenceNumber = ack.summaryOp.referenceSequenceNumber;
@@ -235,7 +232,7 @@ export class RunningSummarizer extends TypedEventEmitter {
235
232
  }
236
233
  }
237
234
  dispose() {
238
- this.runtime.off("op", this.runtimeListener);
235
+ this.cleanupEventListeners();
239
236
  this.summaryWatcher.dispose();
240
237
  this.heuristicRunner?.dispose();
241
238
  this.heuristicRunner = undefined;
@@ -245,6 +242,27 @@ export class RunningSummarizer extends TypedEventEmitter {
245
242
  this._disposed = true;
246
243
  this.stopping = true;
247
244
  }
245
+ setupEventListeners() {
246
+ const runtimeListener = (op, runtimeMessage) => {
247
+ this.handleOp(op, runtimeMessage === true);
248
+ };
249
+ this.runtime.on("op", runtimeListener);
250
+ this.eventsCleanup.push(() => this.runtime.off("op", runtimeListener));
251
+ // Forward events
252
+ for (const event of ["summarizeTimeout"]) {
253
+ const listener = (...args) => {
254
+ this.emit(event, ...args);
255
+ };
256
+ this.generator.on(event, listener);
257
+ this.eventsCleanup.push(() => this.generator.off(event, listener));
258
+ }
259
+ }
260
+ cleanupEventListeners() {
261
+ for (const cleanup of this.eventsCleanup) {
262
+ cleanup();
263
+ }
264
+ this.eventsCleanup.length = 0;
265
+ }
248
266
  handleOp(op, runtimeMessage) {
249
267
  this.heuristicData.lastOpSequenceNumber = op.sequenceNumber;
250
268
  if (runtimeMessage) {
@@ -421,10 +439,11 @@ export class RunningSummarizer extends TypedEventEmitter {
421
439
  numUnsummarizedNonRuntimeOps: this.heuristicData.numNonRuntimeOps,
422
440
  isLastSummary,
423
441
  });
424
- this.mc.logger.sendErrorEvent({
442
+ summaryLogger.sendErrorEvent({
425
443
  eventName: "SummarizeFailed",
426
444
  maxAttempts: 1,
427
445
  summaryAttempts: 1,
446
+ isLastSummary,
428
447
  }, result.error);
429
448
  if (isLastSummary) {
430
449
  this.lastSummarizeFailureEventProps = {
@@ -462,23 +481,23 @@ export class RunningSummarizer extends TypedEventEmitter {
462
481
  }, () => {
463
482
  this.afterSummaryAction();
464
483
  }).catch((error) => {
465
- this.mc.logger.sendErrorEvent({ eventName: "UnexpectedSummarizeError" }, error);
484
+ this.mc.logger.sendErrorEvent({ eventName: "UnexpectedSummarizeError", summarizeReason: reason }, error);
466
485
  });
467
486
  }
468
487
  /**
469
488
  * Tries to summarize with retries where retry is based on the failure params.
470
489
  * For example, summarization may be retried for failures with "retryAfterSeconds" param.
471
490
  */
472
- async trySummarizeWithRetries(reason) {
491
+ async trySummarizeWithRetries(reason, summarizeOptions = {}) {
473
492
  // Helper to set summarize options, telemetry properties and call summarize.
474
493
  const attemptSummarize = (attemptNumber, finalAttempt) => {
475
- const summarizeOptions = {
476
- fullTree: false,
494
+ const attemptSummarizeOptions = {
495
+ fullTree: summarizeOptions.fullTree ?? false,
477
496
  };
478
497
  const summarizeProps = {
479
498
  summarizeReason: reason,
480
499
  summaryAttempts: attemptNumber,
481
- ...summarizeOptions,
500
+ ...attemptSummarizeOptions,
482
501
  finalAttempt,
483
502
  };
484
503
  const summaryLogger = createChildLogger({
@@ -486,7 +505,7 @@ export class RunningSummarizer extends TypedEventEmitter {
486
505
  properties: { all: summarizeProps },
487
506
  });
488
507
  const summaryOptions = {
489
- ...summarizeOptions,
508
+ ...attemptSummarizeOptions,
490
509
  summaryLogger,
491
510
  cancellationToken: this.cancellationToken,
492
511
  finalAttempt,
@@ -605,6 +624,8 @@ export class RunningSummarizer extends TypedEventEmitter {
605
624
  eventName: "SummarizeFailed",
606
625
  maxAttempts,
607
626
  summaryAttempts: currentAttempt,
627
+ summarizeReason: reason,
628
+ isLastSummary: reason === "lastSummary",
608
629
  }, error);
609
630
  this.lastSummarizeFailureEventProps = {
610
631
  currentAttempt,
@@ -620,8 +641,8 @@ export class RunningSummarizer extends TypedEventEmitter {
620
641
  * Attempts to generate a summary on demand with retries in case of failures. The retry logic is the same
621
642
  * as heuristics based summaries.
622
643
  */
623
- async summarizeOnDemandWithRetries(reason, resultsBuilder) {
624
- const results = await this.trySummarizeWithRetries(reason);
644
+ async summarizeOnDemandWithRetries(reason, resultsBuilder, summarizeOptions = {}) {
645
+ const results = await this.trySummarizeWithRetries(reason, summarizeOptions);
625
646
  if (results === undefined) {
626
647
  resultsBuilder.fail("Summarization was canceled", new RetriableSummaryError("Summarization was canceled"));
627
648
  return resultsBuilder.build();
@@ -648,9 +669,9 @@ export class RunningSummarizer extends TypedEventEmitter {
648
669
  // The heuristics are blocking concurrent summarize attempts.
649
670
  throw new UsageError("Attempted to run an already-running summarizer on demand");
650
671
  }
651
- const { reason, ...summarizeOptions } = options;
652
- if (options.retryOnFailure === true) {
653
- this.summarizeOnDemandWithRetries(`onDemand;${reason}`, resultsBuilder).catch((error) => {
672
+ const { reason, retryOnFailure, ...summarizeOptions } = options;
673
+ if (retryOnFailure === true) {
674
+ this.summarizeOnDemandWithRetries(`onDemand;${reason}`, resultsBuilder, summarizeOptions).catch((error) => {
654
675
  resultsBuilder.fail("summarize failed", error);
655
676
  });
656
677
  }