@letpeoplework/lighthouse-client 1.10.0 → 1.12.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.
package/dist/index.d.cts CHANGED
@@ -8,8 +8,10 @@ export type PlainUsageDataEventName = "TeamCreated" | "TeamDeleted" | "Portfolio
8
8
  export type SizingUsageDataEventName = "TeamSizingVoteCast" | "TeamSizingReadinessReached";
9
9
  /** The usage event that says which verdict a Team's Refinement showed on its Refinement day. */
10
10
  export type VerdictUsageDataEventName = "TeamRefinementDayVerdictShown";
11
+ /** The usage event that says a report was read, and of which type. */
12
+ export type ReportUsageDataEventName = "ReportOpened";
11
13
  /** The usage events a client reports, by the names Lighthouse already counts for the web. */
12
- export type UsageDataEventName = PlainUsageDataEventName | SizingUsageDataEventName | VerdictUsageDataEventName;
14
+ export type UsageDataEventName = PlainUsageDataEventName | SizingUsageDataEventName | VerdictUsageDataEventName | ReportUsageDataEventName;
13
15
  /** Fewer Work Items ready than needed, enough, more than enough, or no number at all. */
14
16
  export type UsageDataRefinementVerdict = "Below" | "In" | "Above" | "None";
15
17
  export type UsageDataSizingMoment = "NoCadence" | "OnRefinementDay" | "OnOtherDay";
@@ -22,7 +24,19 @@ export type UsageDataOccurrence = {
22
24
  } | {
23
25
  readonly name: VerdictUsageDataEventName;
24
26
  readonly refinementVerdict: UsageDataRefinementVerdict;
27
+ } | {
28
+ readonly name: ReportUsageDataEventName;
29
+ readonly reportTemplate: UsageDataReportTemplate;
25
30
  };
31
+ /** A report's type as Lighthouse names it when it sends the report. */
32
+ export type ReportTemplateKey = "then-and-now";
33
+ /** A report's type in the words usage data publishes, the same the web uses. */
34
+ export type UsageDataReportTemplate = "ThenAndNow";
35
+ /**
36
+ * The opening of a report Lighthouse sent: its type and nothing else about it. A refused read, or a report of a
37
+ * type this version does not know, counts nothing.
38
+ */
39
+ export declare const reportOpenedOccurrencesOf: (answered: LighthouseApiResult<unknown>) => readonly UsageDataOccurrence[];
26
40
  /** What Lighthouse's answer about a Team's Refinement says about today. */
27
41
  export type RefinementMomentFacts = {
28
42
  readonly nextRefinementDate: string | null;
@@ -195,6 +209,7 @@ export type DeliveryListItem = {
195
209
  readonly hasSufficientData: boolean | undefined;
196
210
  readonly isOverdue: boolean | undefined;
197
211
  readonly likelyBy: string | undefined;
212
+ readonly likelyByBeyondHorizonYears?: number;
198
213
  };
199
214
  /** The Portfolio whose Deliveries are listed; its name stays undefined when it could not be read. */
200
215
  export type DeliveryListOwner = {
@@ -269,7 +284,7 @@ export declare const describeDeliveryFeatureHeadings: (terms: Terms) => string[]
269
284
  export declare const describeDeliveryFeatureRow: (feature: DeliveryFeatureMetric) => string[];
270
285
  /** The forecast distribution's column headings. */
271
286
  export declare const describeDeliveryChanceHeadings: () => string[];
272
- /** One chance of the day's forecast: "85%" and the day it is that likely to be done by. */
287
+ /** One chance of the day's forecast: "85%" and the day it is that likely to be done by, or "More than 5 years". */
273
288
  export declare const describeDeliveryChanceRow: (chance: DeliveryWhenDistributionPoint) => string[];
274
289
  //#endregion
275
290
  //#region src/featureWording.d.ts
@@ -277,6 +292,7 @@ export declare const describeDeliveryChanceRow: (chance: DeliveryWhenDistributio
277
292
  export type FeatureStart = {
278
293
  readonly observedOn: string | undefined;
279
294
  readonly likelyBy: string | undefined;
295
+ readonly likelyByBeyondHorizonYears?: number;
280
296
  };
281
297
  /** One Feature as a row of the Feature list states it. */
282
298
  export type FeatureListItem = {
@@ -288,6 +304,7 @@ export type FeatureListItem = {
288
304
  readonly cannotBeForecast: boolean;
289
305
  readonly start: FeatureStart;
290
306
  readonly likelyBy: string | undefined;
307
+ readonly likelyByBeyondHorizonYears?: number;
291
308
  };
292
309
  /**
293
310
  * Every Feature in the answer, or null when it is not a list or any one of them comes without its
@@ -305,8 +322,11 @@ export declare const describeFeatureProgress: (feature: Pick<FeatureListItem, "t
305
322
  * Team without history; that Team only stops anyone saying when work will begin.
306
323
  */
307
324
  export declare const describeFeatureStart: (feature: Pick<FeatureListItem, "start" | "cannotBeForecast">) => string;
308
- /** The day the Feature is 85% likely to be done by, "Cannot forecast", or the mark when none was sent. */
309
- export declare const describeFeatureCompletion: (feature: Pick<FeatureListItem, "likelyBy" | "cannotBeForecast">) => string;
325
+ /**
326
+ * The day the Feature is 85% likely to be done by, "More than 5 years" when that lies beyond the simulation
327
+ * horizon, "Cannot forecast", or the mark when none was sent.
328
+ */
329
+ export declare const describeFeatureCompletion: (feature: Pick<FeatureListItem, "likelyBy" | "likelyByBeyondHorizonYears" | "cannotBeForecast">) => string;
310
330
  /** One Feature as a row of the list, in the order of its headings. */
311
331
  export declare const describeFeatureRow: (feature: FeatureListItem, terms: Terms) => string[];
312
332
  /** One Work Item of a Feature as the Feature's Work Items list states it. */
@@ -357,11 +377,33 @@ export declare const deliveryLikelihoodAnswer: (facts: Parameters<typeof likelih
357
377
  readonly isOverdue?: boolean;
358
378
  }) => string;
359
379
  //#endregion
380
+ //#region src/forecastPercentileText.d.ts
381
+ /**
382
+ * A forecast percentile as Lighthouse sends it. A percentile too few simulated runs reached carries
383
+ * `beyondHorizon` and the horizon's length in `horizonYears`; its `expectedDate` is then only a stand-in
384
+ * that nothing forecast, kept so an older client still reads a date. An older Lighthouse sends neither.
385
+ */
386
+ export type ForecastPercentileDate = {
387
+ readonly expectedDate: string;
388
+ readonly beyondHorizon?: boolean;
389
+ readonly horizonYears?: number | null;
390
+ };
391
+ /**
392
+ * The years of the horizon a percentile lies beyond, or undefined when its date is the forecast. Keyed on
393
+ * the flag itself, never on the server's version: an older Lighthouse never sends it.
394
+ */
395
+ export declare const yearsBeyondHorizon: (percentile: unknown) => number | undefined;
396
+ /** The words shown in place of a date for a percentile too few simulated runs reached. */
397
+ export declare const moreThanYearsText: (horizonYears: number) => string;
398
+ /** A percentile's day as a person reads it, or "More than 5 years" when it lies beyond that horizon. */
399
+ export declare const describePercentileDay: (expectedDate: string, horizonYearsBeyond: number | undefined) => string;
400
+ /** One percentile as text: its day, or the words when it lies beyond the horizon. */
401
+ export declare const describePercentileDate: (percentile: ForecastPercentileDate) => string;
402
+ //#endregion
360
403
  //#region src/forecastWording.d.ts
361
404
  /** One row of the When table: the chance of being done by a calendar day. */
362
- export type ForecastChanceByDay = {
405
+ export type ForecastChanceByDay = ForecastPercentileDate & {
363
406
  readonly probability: number;
364
- readonly expectedDate: string;
365
407
  };
366
408
  /** One row of the How Many table: the chance of getting this many done. */
367
409
  export type ForecastChanceOfCount = {
@@ -532,7 +574,15 @@ export declare const readArrivals: typeof readDailyCountChart;
532
574
  * range's first day, read as the total and the count of each day. Without a total the days are summed.
533
575
  */
534
576
  export declare const readRunChart: (value: unknown, range: MetricsDateRange) => DailyCountChartView | null;
535
- /** A Work Item in progress; an older Lighthouse does not say whether it is blocked. */
577
+ declare const STALE_REASON_KINDS: readonly ["TimeInState", "BlockedDuration", "TimeInStateWhileBlocked"];
578
+ type StaleReasonKind = (typeof STALE_REASON_KINDS)[number];
579
+ /** Why Lighthouse marks a Work Item stale, in whole days on the instance's calendar. */
580
+ export type StaleReason = {
581
+ readonly kind: StaleReasonKind;
582
+ readonly days: number;
583
+ readonly stateName?: string;
584
+ };
585
+ /** A Work Item in progress; an older Lighthouse does not say whether it is blocked, or stale. */
536
586
  export type InProgressItem = {
537
587
  readonly isBlocked: boolean | undefined;
538
588
  readonly referenceId?: string;
@@ -540,6 +590,8 @@ export type InProgressItem = {
540
590
  readonly state?: string;
541
591
  readonly workItemAge?: number;
542
592
  readonly blockedSince?: string;
593
+ readonly isStale?: boolean;
594
+ readonly staleReasons?: readonly StaleReason[];
543
595
  };
544
596
  export type InProgressNowView = {
545
597
  readonly asOfDate: string;
@@ -621,7 +673,7 @@ export declare const PREDICTABILITY_SCORE_EXPLANATION = "The predictability scor
621
673
  /** What an empty over-time chart says on the web. */
622
674
  export declare const OVER_TIME_EMPTY_SENTENCE = "Nothing to show for the selected range. Days appear here as Lighthouse records them.";
623
675
  /** Every part of the headline that can be refused or unreadable on its own. */
624
- export type MetricsHeadlinePart = "wip" | "throughput" | "arrivals" | "blocked" | "totalWorkItemAge" | "predictabilityScore" | "cycleTimePercentiles" | "workItemAgePercentiles" | "workItemAge" | "cumulativeStateTime" | "percentilesOverTime" | "processBehaviorOverTime";
676
+ export type MetricsHeadlinePart = "wip" | "throughput" | "arrivals" | "blocked" | "stale" | "totalWorkItemAge" | "predictabilityScore" | "cycleTimePercentiles" | "workItemAgePercentiles" | "workItemAge" | "cumulativeStateTime" | "percentilesOverTime" | "processBehaviorOverTime";
625
677
  /** "1 day", "12 days". */
626
678
  export declare const describeDays: (days: number) => string;
627
679
  /** The label each part of the headline goes by, in the instance's words. */
@@ -640,10 +692,13 @@ export declare const describeAsOfHeading: (subject: Pick<MetricsSubject, "endDat
640
692
  export declare const describeInProgressNow: (now: InProgressNowView, scope: MetricsScope, terms: Terms, systemWipLimit: number | undefined) => MetricLine;
641
693
  /** "Blocked Work Items 2", or null when Lighthouse does not say which items are blocked. */
642
694
  export declare const describeBlockedNow: (now: InProgressNowView, scope: MetricsScope, terms: Terms) => MetricLine | null;
695
+ /** "Stale Work Items 2", or null when Lighthouse does not say which items are stale. */
696
+ export declare const describeStaleNow: (now: InProgressNowView, scope: MetricsScope, terms: Terms) => MetricLine | null;
643
697
  /**
644
698
  * The sentences that stand in for what a WIP answer cannot show: no System WIP Limit, a Lighthouse that does
645
- * not say which Work Items are Blocked (which is not the same as none being Blocked), and nothing in progress.
646
- * A limit of null means the Team or Portfolio could not be read; it may well have one, so nothing is said.
699
+ * not say which Work Items are Blocked or Stale (which is not the same as none being so), and nothing in
700
+ * progress. A limit of null means the Team or Portfolio could not be read; it may well have one, so nothing
701
+ * is said.
647
702
  */
648
703
  export declare const describeWhatWipLeavesUnsaid: (now: InProgressNowView, scope: MetricsScope, terms: Terms, systemWipLimit: number | undefined | null) => readonly string[];
649
704
  /** "Total Throughput 31 1.0 / day". */
@@ -1010,6 +1065,86 @@ export declare const myVoteOn: (refinement: Pick<TeamRefinement, "workItems">, w
1010
1065
  /** {@link nameOfMyVote}, read from Lighthouse; null when the log cannot be read either. */
1011
1066
  export declare const readNameOfMyVote: (client: Pick<LighthouseClient, "getRefinementLog">, teamId: number, workItem: string, voterKey: string | undefined) => Promise<string | null>;
1012
1067
  //#endregion
1068
+ //#region src/reportWording.d.ts
1069
+ /** Who a report belongs to: a Team or a Portfolio. */
1070
+ export type ReportOwnerKind = "team" | "portfolio";
1071
+ /** The Team or Portfolio whose reports are read, by its id. */
1072
+ export type ReportOwner = {
1073
+ readonly kind: ReportOwnerKind;
1074
+ readonly id: number;
1075
+ };
1076
+ /** A window of days as Lighthouse sends it: its first and its last day. */
1077
+ export type ReportWindow = {
1078
+ readonly start: string;
1079
+ readonly end: string;
1080
+ };
1081
+ /** What a report's summary says: its name and its two windows. */
1082
+ export type ReportView = {
1083
+ readonly name: string;
1084
+ readonly thenWindow: ReportWindow;
1085
+ readonly nowWindow: ReportWindow;
1086
+ };
1087
+ /** One report as a list row shows it. Fields Lighthouse did not send stay undefined. */
1088
+ export type ReportListItem = {
1089
+ readonly id: number;
1090
+ readonly name: string;
1091
+ readonly templateKey: string | undefined;
1092
+ readonly createdOn: string | undefined;
1093
+ };
1094
+ /** The report's name and windows, or null when the answer does not carry all three. */
1095
+ export declare const readReport: (value: unknown) => ReportView | null;
1096
+ /**
1097
+ * Every report in the list, or null when the answer holds no list or any one report comes without its id or
1098
+ * name: a row that cannot say which report it is would misname the whole list.
1099
+ */
1100
+ export declare const readReportList: (value: unknown) => ReportListItem[] | null;
1101
+ /** The owner as the instance names it, "Team Lightspeed", or by its id when its name could not be read. */
1102
+ export declare const describeReportOwner: (kind: ReportOwnerKind, id: number, owner: unknown, terms: Terms) => string;
1103
+ /** The report's name, its owner and its two windows, one to a line. */
1104
+ export declare const describeReportSummary: (report: ReportView, owner: string) => string;
1105
+ /** How many reports the owner has, then each report's name, type and created day. */
1106
+ export declare const describeReportListSummary: (reports: readonly ReportListItem[], owner: string) => string;
1107
+ /** A summary of Lighthouse's answer, said of its owner; null when the answer is not one the summary can read. */
1108
+ export type ReportSummariser = (value: unknown, owner: string) => string | null;
1109
+ export declare const summariseReport: ReportSummariser;
1110
+ export declare const summariseReportList: ReportSummariser;
1111
+ /** What was read: the owner's list of reports, or one report. */
1112
+ export type ReportRead = "list" | "report";
1113
+ /**
1114
+ * Why a report or a list could not be read, in words the reader can act on: the web's sentence where it has
1115
+ * one. Any other refusal, the client's own "upgrade Lighthouse" among them, keeps its category and reason.
1116
+ */
1117
+ export declare const describeReportRefusal: (error: LighthouseApiError, kind: ReportOwnerKind, read: ReportRead, terms: Terms) => string;
1118
+ /**
1119
+ * {@link describeReportRefusal} in the instance's own words. A refusal the client made before asking, as for a
1120
+ * Lighthouse too old for reports, asks that Lighthouse nothing more, not even its words.
1121
+ */
1122
+ export declare const readReportRefusal: (source: TermsSource, error: LighthouseApiError, kind: ReportOwnerKind, read: ReportRead) => Promise<string>;
1123
+ //#endregion
1124
+ //#region src/reportReads.d.ts
1125
+ /** The four report reads, a Team's and a Portfolio's list and one report of each. */
1126
+ export type ReportReads = Pick<LighthouseClient, "getTeamReports" | "getTeamReport" | "getPortfolioReports" | "getPortfolioReport">;
1127
+ /** The owner's list of reports, exactly as Lighthouse answers it. */
1128
+ export declare const readOwnersReports: (reads: ReportReads, owner: ReportOwner) => Promise<LighthouseApiResult<unknown>>;
1129
+ /** One of the owner's reports, exactly as Lighthouse answers it. */
1130
+ export declare const readOwnersReport: (reads: ReportReads, owner: ReportOwner, reportId: number) => Promise<LighthouseApiResult<unknown>>;
1131
+ type OwnerRead = (id: number) => Promise<{
1132
+ readonly ok: true;
1133
+ readonly value: unknown;
1134
+ } | {
1135
+ readonly ok: false;
1136
+ }>;
1137
+ /** Where the owner's name and the instance's words are read from. */
1138
+ export type ReportOwnerSource = TermsSource & {
1139
+ readonly getTeam: OwnerRead;
1140
+ readonly getPortfolio: OwnerRead;
1141
+ };
1142
+ /**
1143
+ * {@link describeReportOwner} for an owner read from Lighthouse. Its name only labels a summary, so an owner that
1144
+ * cannot be read is named by its id instead, and this never fails.
1145
+ */
1146
+ export declare const readReportOwner: (source: ReportOwnerSource, owner: ReportOwner) => Promise<string>;
1147
+ //#endregion
1013
1148
  //#region src/usageDataStore.d.ts
1014
1149
  /** The answer kept for a Lighthouse, undefined when never asked there, or "unreadable" when the file is not ours. */
1015
1150
  export type UsageDataStoreReading = StoredUsageDataAnswer | undefined | "unreadable";
@@ -1431,6 +1566,10 @@ export type DeliveryFeatureMetric = {
1431
1566
  export type DeliveryWhenDistributionPoint = {
1432
1567
  readonly probability: number;
1433
1568
  readonly expectedDate: string;
1569
+ /** True when too few simulated runs reached this chance: `expectedDate` is then only a stand-in. Absent on an older Lighthouse. */
1570
+ readonly beyondHorizon?: boolean;
1571
+ /** The simulation horizon, in years, this chance was forecast with. Absent on an older Lighthouse and on days recorded before it. */
1572
+ readonly horizonYears?: number | null;
1434
1573
  };
1435
1574
  /** A delivery as it stood on one recorded day. Dates are ISO strings. */
1436
1575
  export type DeliveryMetricsHistoryPoint = {
@@ -1754,6 +1893,11 @@ export type LighthouseClient = {
1754
1893
  readonly addRefinementComment: (teamId: number, workItem: string, comment: RefinementCommentInput) => Promise<LighthouseApiResult<VotedRow>>;
1755
1894
  readonly takeBackRefinementVote: (teamId: number, workItem: string, takeBack: RefinementTakeBackInput) => Promise<LighthouseApiResult<VotedRow>>;
1756
1895
  readonly getRefinementLog: (teamId: number, workItem: string, options?: RefinementReadOptions) => Promise<LighthouseApiResult<SizingLog>>;
1896
+ /** A report list or a report exactly as Lighthouse answers it, so nothing on the way rounds or judges a value. */
1897
+ readonly getTeamReports: (teamId: number) => Promise<LighthouseApiResult<unknown>>;
1898
+ readonly getTeamReport: (teamId: number, reportId: number) => Promise<LighthouseApiResult<unknown>>;
1899
+ readonly getPortfolioReports: (portfolioId: number) => Promise<LighthouseApiResult<unknown>>;
1900
+ readonly getPortfolioReport: (portfolioId: number, reportId: number) => Promise<LighthouseApiResult<unknown>>;
1757
1901
  readonly getTerminology: () => Promise<LighthouseApiResult<readonly TerminologyEntry[]>>;
1758
1902
  readonly listPortfolios: () => Promise<LighthouseApiResult<readonly unknown[]>>;
1759
1903
  readonly getPortfolio: (portfolioId: number) => Promise<LighthouseApiResult<unknown>>;
@@ -1851,6 +1995,8 @@ export declare const FEATURE_REQUIRES_SERVER_NEWER_THAN: {
1851
1995
  readonly sleRisk: "v26.9.19.10";
1852
1996
  readonly teamRefinement: "v26.10.3.6";
1853
1997
  readonly refinementVotes: "v26.10.3.6";
1998
+ readonly staleness: "v26.10.16.6";
1999
+ readonly reports: "v26.10.10.1";
1854
2000
  };
1855
2001
  /**
1856
2002
  * Returns true when `candidate` is strictly newer than `baseline`, false when
@@ -1861,4 +2007,5 @@ export declare const isServerVersionNewerThan: (candidate: string, baseline: str
1861
2007
  /** The header a client sends its voter key in, so Lighthouse can tell its votes from anyone else's. */
1862
2008
  export declare const VOTER_KEY_HEADER = "X-Lighthouse-Voter-Key";
1863
2009
  export declare const createLighthouseClient: (configuration: LighthouseClientConfiguration, dependencies?: LighthouseClientDependencies) => LighthouseClient;
1864
- //#endregion
2010
+ //#endregion
2011
+ export {};
package/dist/index.d.ts CHANGED
@@ -8,8 +8,10 @@ export type PlainUsageDataEventName = "TeamCreated" | "TeamDeleted" | "Portfolio
8
8
  export type SizingUsageDataEventName = "TeamSizingVoteCast" | "TeamSizingReadinessReached";
9
9
  /** The usage event that says which verdict a Team's Refinement showed on its Refinement day. */
10
10
  export type VerdictUsageDataEventName = "TeamRefinementDayVerdictShown";
11
+ /** The usage event that says a report was read, and of which type. */
12
+ export type ReportUsageDataEventName = "ReportOpened";
11
13
  /** The usage events a client reports, by the names Lighthouse already counts for the web. */
12
- export type UsageDataEventName = PlainUsageDataEventName | SizingUsageDataEventName | VerdictUsageDataEventName;
14
+ export type UsageDataEventName = PlainUsageDataEventName | SizingUsageDataEventName | VerdictUsageDataEventName | ReportUsageDataEventName;
13
15
  /** Fewer Work Items ready than needed, enough, more than enough, or no number at all. */
14
16
  export type UsageDataRefinementVerdict = "Below" | "In" | "Above" | "None";
15
17
  export type UsageDataSizingMoment = "NoCadence" | "OnRefinementDay" | "OnOtherDay";
@@ -22,7 +24,19 @@ export type UsageDataOccurrence = {
22
24
  } | {
23
25
  readonly name: VerdictUsageDataEventName;
24
26
  readonly refinementVerdict: UsageDataRefinementVerdict;
27
+ } | {
28
+ readonly name: ReportUsageDataEventName;
29
+ readonly reportTemplate: UsageDataReportTemplate;
25
30
  };
31
+ /** A report's type as Lighthouse names it when it sends the report. */
32
+ export type ReportTemplateKey = "then-and-now";
33
+ /** A report's type in the words usage data publishes, the same the web uses. */
34
+ export type UsageDataReportTemplate = "ThenAndNow";
35
+ /**
36
+ * The opening of a report Lighthouse sent: its type and nothing else about it. A refused read, or a report of a
37
+ * type this version does not know, counts nothing.
38
+ */
39
+ export declare const reportOpenedOccurrencesOf: (answered: LighthouseApiResult<unknown>) => readonly UsageDataOccurrence[];
26
40
  /** What Lighthouse's answer about a Team's Refinement says about today. */
27
41
  export type RefinementMomentFacts = {
28
42
  readonly nextRefinementDate: string | null;
@@ -195,6 +209,7 @@ export type DeliveryListItem = {
195
209
  readonly hasSufficientData: boolean | undefined;
196
210
  readonly isOverdue: boolean | undefined;
197
211
  readonly likelyBy: string | undefined;
212
+ readonly likelyByBeyondHorizonYears?: number;
198
213
  };
199
214
  /** The Portfolio whose Deliveries are listed; its name stays undefined when it could not be read. */
200
215
  export type DeliveryListOwner = {
@@ -269,7 +284,7 @@ export declare const describeDeliveryFeatureHeadings: (terms: Terms) => string[]
269
284
  export declare const describeDeliveryFeatureRow: (feature: DeliveryFeatureMetric) => string[];
270
285
  /** The forecast distribution's column headings. */
271
286
  export declare const describeDeliveryChanceHeadings: () => string[];
272
- /** One chance of the day's forecast: "85%" and the day it is that likely to be done by. */
287
+ /** One chance of the day's forecast: "85%" and the day it is that likely to be done by, or "More than 5 years". */
273
288
  export declare const describeDeliveryChanceRow: (chance: DeliveryWhenDistributionPoint) => string[];
274
289
  //#endregion
275
290
  //#region src/featureWording.d.ts
@@ -277,6 +292,7 @@ export declare const describeDeliveryChanceRow: (chance: DeliveryWhenDistributio
277
292
  export type FeatureStart = {
278
293
  readonly observedOn: string | undefined;
279
294
  readonly likelyBy: string | undefined;
295
+ readonly likelyByBeyondHorizonYears?: number;
280
296
  };
281
297
  /** One Feature as a row of the Feature list states it. */
282
298
  export type FeatureListItem = {
@@ -288,6 +304,7 @@ export type FeatureListItem = {
288
304
  readonly cannotBeForecast: boolean;
289
305
  readonly start: FeatureStart;
290
306
  readonly likelyBy: string | undefined;
307
+ readonly likelyByBeyondHorizonYears?: number;
291
308
  };
292
309
  /**
293
310
  * Every Feature in the answer, or null when it is not a list or any one of them comes without its
@@ -305,8 +322,11 @@ export declare const describeFeatureProgress: (feature: Pick<FeatureListItem, "t
305
322
  * Team without history; that Team only stops anyone saying when work will begin.
306
323
  */
307
324
  export declare const describeFeatureStart: (feature: Pick<FeatureListItem, "start" | "cannotBeForecast">) => string;
308
- /** The day the Feature is 85% likely to be done by, "Cannot forecast", or the mark when none was sent. */
309
- export declare const describeFeatureCompletion: (feature: Pick<FeatureListItem, "likelyBy" | "cannotBeForecast">) => string;
325
+ /**
326
+ * The day the Feature is 85% likely to be done by, "More than 5 years" when that lies beyond the simulation
327
+ * horizon, "Cannot forecast", or the mark when none was sent.
328
+ */
329
+ export declare const describeFeatureCompletion: (feature: Pick<FeatureListItem, "likelyBy" | "likelyByBeyondHorizonYears" | "cannotBeForecast">) => string;
310
330
  /** One Feature as a row of the list, in the order of its headings. */
311
331
  export declare const describeFeatureRow: (feature: FeatureListItem, terms: Terms) => string[];
312
332
  /** One Work Item of a Feature as the Feature's Work Items list states it. */
@@ -357,11 +377,33 @@ export declare const deliveryLikelihoodAnswer: (facts: Parameters<typeof likelih
357
377
  readonly isOverdue?: boolean;
358
378
  }) => string;
359
379
  //#endregion
380
+ //#region src/forecastPercentileText.d.ts
381
+ /**
382
+ * A forecast percentile as Lighthouse sends it. A percentile too few simulated runs reached carries
383
+ * `beyondHorizon` and the horizon's length in `horizonYears`; its `expectedDate` is then only a stand-in
384
+ * that nothing forecast, kept so an older client still reads a date. An older Lighthouse sends neither.
385
+ */
386
+ export type ForecastPercentileDate = {
387
+ readonly expectedDate: string;
388
+ readonly beyondHorizon?: boolean;
389
+ readonly horizonYears?: number | null;
390
+ };
391
+ /**
392
+ * The years of the horizon a percentile lies beyond, or undefined when its date is the forecast. Keyed on
393
+ * the flag itself, never on the server's version: an older Lighthouse never sends it.
394
+ */
395
+ export declare const yearsBeyondHorizon: (percentile: unknown) => number | undefined;
396
+ /** The words shown in place of a date for a percentile too few simulated runs reached. */
397
+ export declare const moreThanYearsText: (horizonYears: number) => string;
398
+ /** A percentile's day as a person reads it, or "More than 5 years" when it lies beyond that horizon. */
399
+ export declare const describePercentileDay: (expectedDate: string, horizonYearsBeyond: number | undefined) => string;
400
+ /** One percentile as text: its day, or the words when it lies beyond the horizon. */
401
+ export declare const describePercentileDate: (percentile: ForecastPercentileDate) => string;
402
+ //#endregion
360
403
  //#region src/forecastWording.d.ts
361
404
  /** One row of the When table: the chance of being done by a calendar day. */
362
- export type ForecastChanceByDay = {
405
+ export type ForecastChanceByDay = ForecastPercentileDate & {
363
406
  readonly probability: number;
364
- readonly expectedDate: string;
365
407
  };
366
408
  /** One row of the How Many table: the chance of getting this many done. */
367
409
  export type ForecastChanceOfCount = {
@@ -532,7 +574,15 @@ export declare const readArrivals: typeof readDailyCountChart;
532
574
  * range's first day, read as the total and the count of each day. Without a total the days are summed.
533
575
  */
534
576
  export declare const readRunChart: (value: unknown, range: MetricsDateRange) => DailyCountChartView | null;
535
- /** A Work Item in progress; an older Lighthouse does not say whether it is blocked. */
577
+ declare const STALE_REASON_KINDS: readonly ["TimeInState", "BlockedDuration", "TimeInStateWhileBlocked"];
578
+ type StaleReasonKind = (typeof STALE_REASON_KINDS)[number];
579
+ /** Why Lighthouse marks a Work Item stale, in whole days on the instance's calendar. */
580
+ export type StaleReason = {
581
+ readonly kind: StaleReasonKind;
582
+ readonly days: number;
583
+ readonly stateName?: string;
584
+ };
585
+ /** A Work Item in progress; an older Lighthouse does not say whether it is blocked, or stale. */
536
586
  export type InProgressItem = {
537
587
  readonly isBlocked: boolean | undefined;
538
588
  readonly referenceId?: string;
@@ -540,6 +590,8 @@ export type InProgressItem = {
540
590
  readonly state?: string;
541
591
  readonly workItemAge?: number;
542
592
  readonly blockedSince?: string;
593
+ readonly isStale?: boolean;
594
+ readonly staleReasons?: readonly StaleReason[];
543
595
  };
544
596
  export type InProgressNowView = {
545
597
  readonly asOfDate: string;
@@ -621,7 +673,7 @@ export declare const PREDICTABILITY_SCORE_EXPLANATION = "The predictability scor
621
673
  /** What an empty over-time chart says on the web. */
622
674
  export declare const OVER_TIME_EMPTY_SENTENCE = "Nothing to show for the selected range. Days appear here as Lighthouse records them.";
623
675
  /** Every part of the headline that can be refused or unreadable on its own. */
624
- export type MetricsHeadlinePart = "wip" | "throughput" | "arrivals" | "blocked" | "totalWorkItemAge" | "predictabilityScore" | "cycleTimePercentiles" | "workItemAgePercentiles" | "workItemAge" | "cumulativeStateTime" | "percentilesOverTime" | "processBehaviorOverTime";
676
+ export type MetricsHeadlinePart = "wip" | "throughput" | "arrivals" | "blocked" | "stale" | "totalWorkItemAge" | "predictabilityScore" | "cycleTimePercentiles" | "workItemAgePercentiles" | "workItemAge" | "cumulativeStateTime" | "percentilesOverTime" | "processBehaviorOverTime";
625
677
  /** "1 day", "12 days". */
626
678
  export declare const describeDays: (days: number) => string;
627
679
  /** The label each part of the headline goes by, in the instance's words. */
@@ -640,10 +692,13 @@ export declare const describeAsOfHeading: (subject: Pick<MetricsSubject, "endDat
640
692
  export declare const describeInProgressNow: (now: InProgressNowView, scope: MetricsScope, terms: Terms, systemWipLimit: number | undefined) => MetricLine;
641
693
  /** "Blocked Work Items 2", or null when Lighthouse does not say which items are blocked. */
642
694
  export declare const describeBlockedNow: (now: InProgressNowView, scope: MetricsScope, terms: Terms) => MetricLine | null;
695
+ /** "Stale Work Items 2", or null when Lighthouse does not say which items are stale. */
696
+ export declare const describeStaleNow: (now: InProgressNowView, scope: MetricsScope, terms: Terms) => MetricLine | null;
643
697
  /**
644
698
  * The sentences that stand in for what a WIP answer cannot show: no System WIP Limit, a Lighthouse that does
645
- * not say which Work Items are Blocked (which is not the same as none being Blocked), and nothing in progress.
646
- * A limit of null means the Team or Portfolio could not be read; it may well have one, so nothing is said.
699
+ * not say which Work Items are Blocked or Stale (which is not the same as none being so), and nothing in
700
+ * progress. A limit of null means the Team or Portfolio could not be read; it may well have one, so nothing
701
+ * is said.
647
702
  */
648
703
  export declare const describeWhatWipLeavesUnsaid: (now: InProgressNowView, scope: MetricsScope, terms: Terms, systemWipLimit: number | undefined | null) => readonly string[];
649
704
  /** "Total Throughput 31 1.0 / day". */
@@ -1010,6 +1065,86 @@ export declare const myVoteOn: (refinement: Pick<TeamRefinement, "workItems">, w
1010
1065
  /** {@link nameOfMyVote}, read from Lighthouse; null when the log cannot be read either. */
1011
1066
  export declare const readNameOfMyVote: (client: Pick<LighthouseClient, "getRefinementLog">, teamId: number, workItem: string, voterKey: string | undefined) => Promise<string | null>;
1012
1067
  //#endregion
1068
+ //#region src/reportWording.d.ts
1069
+ /** Who a report belongs to: a Team or a Portfolio. */
1070
+ export type ReportOwnerKind = "team" | "portfolio";
1071
+ /** The Team or Portfolio whose reports are read, by its id. */
1072
+ export type ReportOwner = {
1073
+ readonly kind: ReportOwnerKind;
1074
+ readonly id: number;
1075
+ };
1076
+ /** A window of days as Lighthouse sends it: its first and its last day. */
1077
+ export type ReportWindow = {
1078
+ readonly start: string;
1079
+ readonly end: string;
1080
+ };
1081
+ /** What a report's summary says: its name and its two windows. */
1082
+ export type ReportView = {
1083
+ readonly name: string;
1084
+ readonly thenWindow: ReportWindow;
1085
+ readonly nowWindow: ReportWindow;
1086
+ };
1087
+ /** One report as a list row shows it. Fields Lighthouse did not send stay undefined. */
1088
+ export type ReportListItem = {
1089
+ readonly id: number;
1090
+ readonly name: string;
1091
+ readonly templateKey: string | undefined;
1092
+ readonly createdOn: string | undefined;
1093
+ };
1094
+ /** The report's name and windows, or null when the answer does not carry all three. */
1095
+ export declare const readReport: (value: unknown) => ReportView | null;
1096
+ /**
1097
+ * Every report in the list, or null when the answer holds no list or any one report comes without its id or
1098
+ * name: a row that cannot say which report it is would misname the whole list.
1099
+ */
1100
+ export declare const readReportList: (value: unknown) => ReportListItem[] | null;
1101
+ /** The owner as the instance names it, "Team Lightspeed", or by its id when its name could not be read. */
1102
+ export declare const describeReportOwner: (kind: ReportOwnerKind, id: number, owner: unknown, terms: Terms) => string;
1103
+ /** The report's name, its owner and its two windows, one to a line. */
1104
+ export declare const describeReportSummary: (report: ReportView, owner: string) => string;
1105
+ /** How many reports the owner has, then each report's name, type and created day. */
1106
+ export declare const describeReportListSummary: (reports: readonly ReportListItem[], owner: string) => string;
1107
+ /** A summary of Lighthouse's answer, said of its owner; null when the answer is not one the summary can read. */
1108
+ export type ReportSummariser = (value: unknown, owner: string) => string | null;
1109
+ export declare const summariseReport: ReportSummariser;
1110
+ export declare const summariseReportList: ReportSummariser;
1111
+ /** What was read: the owner's list of reports, or one report. */
1112
+ export type ReportRead = "list" | "report";
1113
+ /**
1114
+ * Why a report or a list could not be read, in words the reader can act on: the web's sentence where it has
1115
+ * one. Any other refusal, the client's own "upgrade Lighthouse" among them, keeps its category and reason.
1116
+ */
1117
+ export declare const describeReportRefusal: (error: LighthouseApiError, kind: ReportOwnerKind, read: ReportRead, terms: Terms) => string;
1118
+ /**
1119
+ * {@link describeReportRefusal} in the instance's own words. A refusal the client made before asking, as for a
1120
+ * Lighthouse too old for reports, asks that Lighthouse nothing more, not even its words.
1121
+ */
1122
+ export declare const readReportRefusal: (source: TermsSource, error: LighthouseApiError, kind: ReportOwnerKind, read: ReportRead) => Promise<string>;
1123
+ //#endregion
1124
+ //#region src/reportReads.d.ts
1125
+ /** The four report reads, a Team's and a Portfolio's list and one report of each. */
1126
+ export type ReportReads = Pick<LighthouseClient, "getTeamReports" | "getTeamReport" | "getPortfolioReports" | "getPortfolioReport">;
1127
+ /** The owner's list of reports, exactly as Lighthouse answers it. */
1128
+ export declare const readOwnersReports: (reads: ReportReads, owner: ReportOwner) => Promise<LighthouseApiResult<unknown>>;
1129
+ /** One of the owner's reports, exactly as Lighthouse answers it. */
1130
+ export declare const readOwnersReport: (reads: ReportReads, owner: ReportOwner, reportId: number) => Promise<LighthouseApiResult<unknown>>;
1131
+ type OwnerRead = (id: number) => Promise<{
1132
+ readonly ok: true;
1133
+ readonly value: unknown;
1134
+ } | {
1135
+ readonly ok: false;
1136
+ }>;
1137
+ /** Where the owner's name and the instance's words are read from. */
1138
+ export type ReportOwnerSource = TermsSource & {
1139
+ readonly getTeam: OwnerRead;
1140
+ readonly getPortfolio: OwnerRead;
1141
+ };
1142
+ /**
1143
+ * {@link describeReportOwner} for an owner read from Lighthouse. Its name only labels a summary, so an owner that
1144
+ * cannot be read is named by its id instead, and this never fails.
1145
+ */
1146
+ export declare const readReportOwner: (source: ReportOwnerSource, owner: ReportOwner) => Promise<string>;
1147
+ //#endregion
1013
1148
  //#region src/usageDataStore.d.ts
1014
1149
  /** The answer kept for a Lighthouse, undefined when never asked there, or "unreadable" when the file is not ours. */
1015
1150
  export type UsageDataStoreReading = StoredUsageDataAnswer | undefined | "unreadable";
@@ -1431,6 +1566,10 @@ export type DeliveryFeatureMetric = {
1431
1566
  export type DeliveryWhenDistributionPoint = {
1432
1567
  readonly probability: number;
1433
1568
  readonly expectedDate: string;
1569
+ /** True when too few simulated runs reached this chance: `expectedDate` is then only a stand-in. Absent on an older Lighthouse. */
1570
+ readonly beyondHorizon?: boolean;
1571
+ /** The simulation horizon, in years, this chance was forecast with. Absent on an older Lighthouse and on days recorded before it. */
1572
+ readonly horizonYears?: number | null;
1434
1573
  };
1435
1574
  /** A delivery as it stood on one recorded day. Dates are ISO strings. */
1436
1575
  export type DeliveryMetricsHistoryPoint = {
@@ -1754,6 +1893,11 @@ export type LighthouseClient = {
1754
1893
  readonly addRefinementComment: (teamId: number, workItem: string, comment: RefinementCommentInput) => Promise<LighthouseApiResult<VotedRow>>;
1755
1894
  readonly takeBackRefinementVote: (teamId: number, workItem: string, takeBack: RefinementTakeBackInput) => Promise<LighthouseApiResult<VotedRow>>;
1756
1895
  readonly getRefinementLog: (teamId: number, workItem: string, options?: RefinementReadOptions) => Promise<LighthouseApiResult<SizingLog>>;
1896
+ /** A report list or a report exactly as Lighthouse answers it, so nothing on the way rounds or judges a value. */
1897
+ readonly getTeamReports: (teamId: number) => Promise<LighthouseApiResult<unknown>>;
1898
+ readonly getTeamReport: (teamId: number, reportId: number) => Promise<LighthouseApiResult<unknown>>;
1899
+ readonly getPortfolioReports: (portfolioId: number) => Promise<LighthouseApiResult<unknown>>;
1900
+ readonly getPortfolioReport: (portfolioId: number, reportId: number) => Promise<LighthouseApiResult<unknown>>;
1757
1901
  readonly getTerminology: () => Promise<LighthouseApiResult<readonly TerminologyEntry[]>>;
1758
1902
  readonly listPortfolios: () => Promise<LighthouseApiResult<readonly unknown[]>>;
1759
1903
  readonly getPortfolio: (portfolioId: number) => Promise<LighthouseApiResult<unknown>>;
@@ -1851,6 +1995,8 @@ export declare const FEATURE_REQUIRES_SERVER_NEWER_THAN: {
1851
1995
  readonly sleRisk: "v26.9.19.10";
1852
1996
  readonly teamRefinement: "v26.10.3.6";
1853
1997
  readonly refinementVotes: "v26.10.3.6";
1998
+ readonly staleness: "v26.10.16.6";
1999
+ readonly reports: "v26.10.10.1";
1854
2000
  };
1855
2001
  /**
1856
2002
  * Returns true when `candidate` is strictly newer than `baseline`, false when
@@ -1861,4 +2007,5 @@ export declare const isServerVersionNewerThan: (candidate: string, baseline: str
1861
2007
  /** The header a client sends its voter key in, so Lighthouse can tell its votes from anyone else's. */
1862
2008
  export declare const VOTER_KEY_HEADER = "X-Lighthouse-Voter-Key";
1863
2009
  export declare const createLighthouseClient: (configuration: LighthouseClientConfiguration, dependencies?: LighthouseClientDependencies) => LighthouseClient;
1864
- //#endregion
2010
+ //#endregion
2011
+ export {};