@letpeoplework/lighthouse-client 1.7.0 → 1.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -32,6 +32,7 @@ __export(index_exports, {
32
32
  pollCliAuthSession: () => pollCliAuthSession,
33
33
  queryServerAuthMode: () => queryServerAuthMode,
34
34
  startCliAuthSession: () => startCliAuthSession,
35
+ summariseDeliveryMetricsHistory: () => summariseDeliveryMetricsHistory,
35
36
  validateLighthouseConnectivity: () => validateLighthouseConnectivity
36
37
  });
37
38
  module.exports = __toCommonJS(index_exports);
@@ -531,6 +532,15 @@ var getDefaultMetricsDateRange = () => {
531
532
  endDate: toIsoDate(end)
532
533
  };
533
534
  };
535
+ var summariseDeliveryMetricsHistory = (history) => history.points.map((point) => ({
536
+ date: point.date,
537
+ totalWork: point.totalWork,
538
+ doneWork: point.doneWork,
539
+ remainingWork: point.remainingWork,
540
+ epicCount: point.featureBreakdown.length,
541
+ estimatedItemCount: point.estimatedItemCount,
542
+ likelihoodPercentage: point.likelihoodPercentage
543
+ }));
534
544
  var getAuthHeaders = (auth) => {
535
545
  if (auth === void 0 || auth.kind === "none") {
536
546
  return {};
@@ -796,7 +806,10 @@ var FEATURE_REQUIRES_SERVER_NEWER_THAN = {
796
806
  mcpOAuthPassThrough: "v26.6.16.14",
797
807
  blockedCountHistory: "v26.7.3.1",
798
808
  percentilesOverTime: "v26.7.11.4",
799
- processBehaviorOverTime: "v26.7.11.4"
809
+ processBehaviorOverTime: "v26.7.11.4",
810
+ // The endpoint landed in v26.6.7.1. The per-epic size fields came much later and are optional on
811
+ // the wire, so a server between the two answers fine — it just reports no sizes.
812
+ deliveryMetricsHistory: "v26.5.29.5"
800
813
  };
801
814
  var parseServerVersion = (raw) => {
802
815
  const trimmed = raw.trim().replace(/^v/iu, "");
@@ -1444,6 +1457,18 @@ var createLighthouseClient = (configuration, dependencies = {}) => {
1444
1457
  `/v1/deliveries/${deliveryId}`,
1445
1458
  { method: "DELETE" }
1446
1459
  ),
1460
+ getDeliveryMetricsHistory: async (deliveryId) => {
1461
+ const unsupported = await ensureServerSupports("deliveryMetricsHistory");
1462
+ if (unsupported) {
1463
+ return unsupported;
1464
+ }
1465
+ return requestJson(
1466
+ configuration,
1467
+ dependencies,
1468
+ `/v1/deliveries/${deliveryId}/metrics-history`,
1469
+ { method: "GET" }
1470
+ );
1471
+ },
1447
1472
  getRecurringBlackoutRules: async () => {
1448
1473
  const unsupported = await ensureServerSupports("recurringBlackoutRules");
1449
1474
  if (unsupported) {
@@ -1520,5 +1545,6 @@ var createLighthouseClient = (configuration, dependencies = {}) => {
1520
1545
  pollCliAuthSession,
1521
1546
  queryServerAuthMode,
1522
1547
  startCliAuthSession,
1548
+ summariseDeliveryMetricsHistory,
1523
1549
  validateLighthouseConnectivity
1524
1550
  });
package/dist/index.d.cts CHANGED
@@ -233,6 +233,68 @@ type BlockedCountSnapshot = {
233
233
  readonly recordedAt: string;
234
234
  readonly blockedCount: number;
235
235
  };
236
+ /**
237
+ * One epic as it stood on the day a delivery snapshot was taken.
238
+ *
239
+ * `likelihood` is null when the epic cannot be forecast (ADR-112). `totalItems` and
240
+ * `isUsingDefaultSize` are absent from every snapshot recorded before Lighthouse began writing
241
+ * sizes, so both are optional and a missing value means "not recorded", never zero.
242
+ */
243
+ type DeliveryFeatureMetric = {
244
+ readonly referenceId: string;
245
+ readonly name: string;
246
+ readonly completion: number;
247
+ readonly likelihood: number | null;
248
+ readonly totalItems?: number | null;
249
+ readonly isUsingDefaultSize?: boolean | null;
250
+ };
251
+ /** One point on a delivery's forecast distribution: the chance of finishing by a date. */
252
+ type DeliveryWhenDistributionPoint = {
253
+ readonly probability: number;
254
+ readonly expectedDate: string;
255
+ };
256
+ /** A delivery as it stood on one recorded day. Dates are ISO strings. */
257
+ type DeliveryMetricsHistoryPoint = {
258
+ readonly date: string;
259
+ readonly targetDateAtSnapshot: string | null;
260
+ readonly totalWork: number;
261
+ readonly doneWork: number;
262
+ readonly remainingWork: number;
263
+ readonly estimatedItemCount: number | null;
264
+ readonly forecastHowMany: number | null;
265
+ readonly likelihoodPercentage: number | null;
266
+ readonly whenDistribution: readonly DeliveryWhenDistributionPoint[] | null;
267
+ readonly featureBreakdown: readonly DeliveryFeatureMetric[];
268
+ };
269
+ /** The whole recorded trend for one delivery. Forward-only: it starts at the first snapshot. */
270
+ type DeliveryMetricsHistory = {
271
+ readonly deliveryDate: string;
272
+ readonly firstSnapshotDate: string | null;
273
+ readonly points: readonly DeliveryMetricsHistoryPoint[];
274
+ };
275
+ /**
276
+ * One day of a delivery, without the per-epic breakdown or the forecast distribution.
277
+ *
278
+ * A ninety-day window over fifteen epics is well over a thousand breakdown objects plus a
279
+ * distribution per day — more than an assistant should be handed by default (ADR-121), and more
280
+ * than a terminal can show. {@link summariseDeliveryMetricsHistory} projects to this.
281
+ */
282
+ type DeliveryMetricsHistorySummaryRow = {
283
+ readonly date: string;
284
+ readonly totalWork: number;
285
+ readonly doneWork: number;
286
+ readonly remainingWork: number;
287
+ readonly epicCount: number;
288
+ readonly estimatedItemCount: number | null;
289
+ readonly likelihoodPercentage: number | null;
290
+ };
291
+ /**
292
+ * Projects a delivery history to one row per recorded day. Pure.
293
+ *
294
+ * The client itself returns the payload whole: dropping data is the caller's choice, so the CLI and
295
+ * the MCP tool apply this by default and step around it when asked for per-epic detail.
296
+ */
297
+ declare const summariseDeliveryMetricsHistory: (history: DeliveryMetricsHistory) => readonly DeliveryMetricsHistorySummaryRow[];
236
298
  /**
237
299
  * Percentile family recorded by the percentiles-over-time pipeline. Sent as the
238
300
  * `metricType` query parameter, and echoed back on every returned row.
@@ -243,9 +305,11 @@ type PercentilesOverTimeMetricType = "CycleTime" | "WorkItemAge";
243
305
  * recorded for {@link recordedAt} (an ISO date string, one row per calendar day,
244
306
  * ascending).
245
307
  *
246
- * Recording is FORWARD-ONLY — Lighthouse starts capturing the day the feature is
247
- * first deployed and never backfills history it did not observe, so a freshly
248
- * upgraded server legitimately returns an empty array until the first refresh.
308
+ * Lighthouse records a day when it refreshes. By default it never fills in a day
309
+ * it did not record, so a freshly upgraded server legitimately returns an empty
310
+ * array until the first refresh. A System Admin can switch on filling in past
311
+ * days (a Preview, off by default); then a read that finds missing days starts
312
+ * working them out in the background, and a later read may return more rows.
249
313
  *
250
314
  * `CycleTime` is recorded per horizon (30/60/90 days); `WorkItemAge` is always
251
315
  * "as of today" and therefore has no horizon dimension, so a horizon sent
@@ -279,7 +343,9 @@ type ProcessBehaviorMetricType = "Throughput" | "WorkItemAge" | "Wip" | "CycleTi
279
343
  * calendar day, ascending). The family is carried by the request's `type`
280
344
  * parameter, not repeated per row.
281
345
  *
282
- * Recording is FORWARD-ONLY, and a day is only recorded when the underlying
346
+ * Days are recorded on refresh, and — where a System Admin has switched on
347
+ * filling in past days — worked out in the background after a read that found
348
+ * them missing. Either way a day is only present when the underlying
283
349
  * chart had a usable baseline — days where it did not are absent from the
284
350
  * series rather than present as a zeroed triple, so an empty array means
285
351
  * "nothing recorded yet", never "a process pinned at zero".
@@ -408,6 +474,7 @@ type LighthouseClient = {
408
474
  readonly createDelivery: (portfolioId: number, payload: LighthouseWritePayload) => Promise<LighthouseApiResult<unknown>>;
409
475
  readonly updateDelivery: (deliveryId: number, payload: LighthouseWritePayload) => Promise<LighthouseApiResult<unknown>>;
410
476
  readonly deleteDelivery: (deliveryId: number) => Promise<LighthouseApiResult<undefined>>;
477
+ readonly getDeliveryMetricsHistory: (deliveryId: number) => Promise<LighthouseApiResult<DeliveryMetricsHistory>>;
411
478
  readonly getRecurringBlackoutRules: () => Promise<LighthouseApiResult<readonly RecurringBlackoutRule[]>>;
412
479
  readonly createRecurringBlackoutRule: (payload: LighthouseWritePayload) => Promise<LighthouseApiResult<RecurringBlackoutRule>>;
413
480
  readonly updateRecurringBlackoutRule: (id: number, payload: LighthouseWritePayload) => Promise<LighthouseApiResult<RecurringBlackoutRule>>;
@@ -434,6 +501,7 @@ declare const FEATURE_REQUIRES_SERVER_NEWER_THAN: {
434
501
  readonly blockedCountHistory: "v26.7.3.1";
435
502
  readonly percentilesOverTime: "v26.7.11.4";
436
503
  readonly processBehaviorOverTime: "v26.7.11.4";
504
+ readonly deliveryMetricsHistory: "v26.5.29.5";
437
505
  };
438
506
  /**
439
507
  * Returns true when `candidate` is strictly newer than `baseline`, false when
@@ -443,4 +511,4 @@ declare const FEATURE_REQUIRES_SERVER_NEWER_THAN: {
443
511
  declare const isServerVersionNewerThan: (candidate: string, baseline: string) => boolean | null;
444
512
  declare const createLighthouseClient: (configuration: LighthouseClientConfiguration, dependencies?: LighthouseClientDependencies) => LighthouseClient;
445
513
 
446
- export { type BacktestInput, type BlockedCountSnapshot, type CliAuthSessionPollResult, type CliAuthSessionStartError, type CliAuthSessionStartOutcome, type CliAuthSessionStartResult, type CliConnection, type CliServerAuthMode, type CliServerConnection, type CliStandaloneConnection, type ClientCapability, type ClientPackageContract, type ConnectivityCategory, type ConnectivityDependencies, type ConnectivityFetchResponse, type ConnectivityValidationResult, type CumulativeStateTimeCandidateRow, type CumulativeStateTimeCandidatesResult, type CumulativeStateTimeItemRow, type CumulativeStateTimeItemsResult, type CumulativeStateTimeResult, type CumulativeStateTimeStateRow, type DailyTotalWorkItemAge, type DailyWorkItemAge, type DayOfWeek, FEATURE_REQUIRES_SERVER_NEWER_THAN, type LighthouseApiError, type LighthouseApiResult, type LighthouseAuthContext, type LighthouseAuthOverrides, type LighthouseAuthStatus, type LighthouseAuthStore, type LighthouseClient, type LighthouseClientAuth, type LighthouseClientConfiguration, type LighthouseClientDependencies, type LighthouseConnectionConfiguration, type LighthouseWritePayload, type ManualForecastInput, type MetricsDateRange, type PercentilesOverTimeMetricType, type PercentilesOverTimeSnapshot, type ProcessBehaviorMetricType, type ProcessBehaviorSnapshot, type RecurringBlackoutRule, type RecurringBlackoutRuleInput, type ResolvedLighthouseEndpoint, type ServerAuthModeResult, type StandaloneDiscoveryContract, type StandaloneDiscoveryContractParseResult, type StoredLighthouseAuth, type ThroughputFilterView, type TotalWorkItemAgeOverTimeResult, type WorkItemAgeEntry, type WorkItemAgeOverTimeResult, createLighthouseAuthContext, createLighthouseClient, getClientPackageContract, getDefaultMetricsDateRange, getStandaloneDiscoveryLockfilePath, isServerVersionNewerThan, loadStandaloneDiscoveryContract, parseStandaloneDiscoveryContract, pollCliAuthSession, queryServerAuthMode, startCliAuthSession, validateLighthouseConnectivity };
514
+ export { type BacktestInput, type BlockedCountSnapshot, type CliAuthSessionPollResult, type CliAuthSessionStartError, type CliAuthSessionStartOutcome, type CliAuthSessionStartResult, type CliConnection, type CliServerAuthMode, type CliServerConnection, type CliStandaloneConnection, type ClientCapability, type ClientPackageContract, type ConnectivityCategory, type ConnectivityDependencies, type ConnectivityFetchResponse, type ConnectivityValidationResult, type CumulativeStateTimeCandidateRow, type CumulativeStateTimeCandidatesResult, type CumulativeStateTimeItemRow, type CumulativeStateTimeItemsResult, type CumulativeStateTimeResult, type CumulativeStateTimeStateRow, type DailyTotalWorkItemAge, type DailyWorkItemAge, type DayOfWeek, type DeliveryFeatureMetric, type DeliveryMetricsHistory, type DeliveryMetricsHistoryPoint, type DeliveryMetricsHistorySummaryRow, type DeliveryWhenDistributionPoint, FEATURE_REQUIRES_SERVER_NEWER_THAN, type LighthouseApiError, type LighthouseApiResult, type LighthouseAuthContext, type LighthouseAuthOverrides, type LighthouseAuthStatus, type LighthouseAuthStore, type LighthouseClient, type LighthouseClientAuth, type LighthouseClientConfiguration, type LighthouseClientDependencies, type LighthouseConnectionConfiguration, type LighthouseWritePayload, type ManualForecastInput, type MetricsDateRange, type PercentilesOverTimeMetricType, type PercentilesOverTimeSnapshot, type ProcessBehaviorMetricType, type ProcessBehaviorSnapshot, type RecurringBlackoutRule, type RecurringBlackoutRuleInput, type ResolvedLighthouseEndpoint, type ServerAuthModeResult, type StandaloneDiscoveryContract, type StandaloneDiscoveryContractParseResult, type StoredLighthouseAuth, type ThroughputFilterView, type TotalWorkItemAgeOverTimeResult, type WorkItemAgeEntry, type WorkItemAgeOverTimeResult, createLighthouseAuthContext, createLighthouseClient, getClientPackageContract, getDefaultMetricsDateRange, getStandaloneDiscoveryLockfilePath, isServerVersionNewerThan, loadStandaloneDiscoveryContract, parseStandaloneDiscoveryContract, pollCliAuthSession, queryServerAuthMode, startCliAuthSession, summariseDeliveryMetricsHistory, validateLighthouseConnectivity };
package/dist/index.d.ts CHANGED
@@ -233,6 +233,68 @@ type BlockedCountSnapshot = {
233
233
  readonly recordedAt: string;
234
234
  readonly blockedCount: number;
235
235
  };
236
+ /**
237
+ * One epic as it stood on the day a delivery snapshot was taken.
238
+ *
239
+ * `likelihood` is null when the epic cannot be forecast (ADR-112). `totalItems` and
240
+ * `isUsingDefaultSize` are absent from every snapshot recorded before Lighthouse began writing
241
+ * sizes, so both are optional and a missing value means "not recorded", never zero.
242
+ */
243
+ type DeliveryFeatureMetric = {
244
+ readonly referenceId: string;
245
+ readonly name: string;
246
+ readonly completion: number;
247
+ readonly likelihood: number | null;
248
+ readonly totalItems?: number | null;
249
+ readonly isUsingDefaultSize?: boolean | null;
250
+ };
251
+ /** One point on a delivery's forecast distribution: the chance of finishing by a date. */
252
+ type DeliveryWhenDistributionPoint = {
253
+ readonly probability: number;
254
+ readonly expectedDate: string;
255
+ };
256
+ /** A delivery as it stood on one recorded day. Dates are ISO strings. */
257
+ type DeliveryMetricsHistoryPoint = {
258
+ readonly date: string;
259
+ readonly targetDateAtSnapshot: string | null;
260
+ readonly totalWork: number;
261
+ readonly doneWork: number;
262
+ readonly remainingWork: number;
263
+ readonly estimatedItemCount: number | null;
264
+ readonly forecastHowMany: number | null;
265
+ readonly likelihoodPercentage: number | null;
266
+ readonly whenDistribution: readonly DeliveryWhenDistributionPoint[] | null;
267
+ readonly featureBreakdown: readonly DeliveryFeatureMetric[];
268
+ };
269
+ /** The whole recorded trend for one delivery. Forward-only: it starts at the first snapshot. */
270
+ type DeliveryMetricsHistory = {
271
+ readonly deliveryDate: string;
272
+ readonly firstSnapshotDate: string | null;
273
+ readonly points: readonly DeliveryMetricsHistoryPoint[];
274
+ };
275
+ /**
276
+ * One day of a delivery, without the per-epic breakdown or the forecast distribution.
277
+ *
278
+ * A ninety-day window over fifteen epics is well over a thousand breakdown objects plus a
279
+ * distribution per day — more than an assistant should be handed by default (ADR-121), and more
280
+ * than a terminal can show. {@link summariseDeliveryMetricsHistory} projects to this.
281
+ */
282
+ type DeliveryMetricsHistorySummaryRow = {
283
+ readonly date: string;
284
+ readonly totalWork: number;
285
+ readonly doneWork: number;
286
+ readonly remainingWork: number;
287
+ readonly epicCount: number;
288
+ readonly estimatedItemCount: number | null;
289
+ readonly likelihoodPercentage: number | null;
290
+ };
291
+ /**
292
+ * Projects a delivery history to one row per recorded day. Pure.
293
+ *
294
+ * The client itself returns the payload whole: dropping data is the caller's choice, so the CLI and
295
+ * the MCP tool apply this by default and step around it when asked for per-epic detail.
296
+ */
297
+ declare const summariseDeliveryMetricsHistory: (history: DeliveryMetricsHistory) => readonly DeliveryMetricsHistorySummaryRow[];
236
298
  /**
237
299
  * Percentile family recorded by the percentiles-over-time pipeline. Sent as the
238
300
  * `metricType` query parameter, and echoed back on every returned row.
@@ -243,9 +305,11 @@ type PercentilesOverTimeMetricType = "CycleTime" | "WorkItemAge";
243
305
  * recorded for {@link recordedAt} (an ISO date string, one row per calendar day,
244
306
  * ascending).
245
307
  *
246
- * Recording is FORWARD-ONLY — Lighthouse starts capturing the day the feature is
247
- * first deployed and never backfills history it did not observe, so a freshly
248
- * upgraded server legitimately returns an empty array until the first refresh.
308
+ * Lighthouse records a day when it refreshes. By default it never fills in a day
309
+ * it did not record, so a freshly upgraded server legitimately returns an empty
310
+ * array until the first refresh. A System Admin can switch on filling in past
311
+ * days (a Preview, off by default); then a read that finds missing days starts
312
+ * working them out in the background, and a later read may return more rows.
249
313
  *
250
314
  * `CycleTime` is recorded per horizon (30/60/90 days); `WorkItemAge` is always
251
315
  * "as of today" and therefore has no horizon dimension, so a horizon sent
@@ -279,7 +343,9 @@ type ProcessBehaviorMetricType = "Throughput" | "WorkItemAge" | "Wip" | "CycleTi
279
343
  * calendar day, ascending). The family is carried by the request's `type`
280
344
  * parameter, not repeated per row.
281
345
  *
282
- * Recording is FORWARD-ONLY, and a day is only recorded when the underlying
346
+ * Days are recorded on refresh, and — where a System Admin has switched on
347
+ * filling in past days — worked out in the background after a read that found
348
+ * them missing. Either way a day is only present when the underlying
283
349
  * chart had a usable baseline — days where it did not are absent from the
284
350
  * series rather than present as a zeroed triple, so an empty array means
285
351
  * "nothing recorded yet", never "a process pinned at zero".
@@ -408,6 +474,7 @@ type LighthouseClient = {
408
474
  readonly createDelivery: (portfolioId: number, payload: LighthouseWritePayload) => Promise<LighthouseApiResult<unknown>>;
409
475
  readonly updateDelivery: (deliveryId: number, payload: LighthouseWritePayload) => Promise<LighthouseApiResult<unknown>>;
410
476
  readonly deleteDelivery: (deliveryId: number) => Promise<LighthouseApiResult<undefined>>;
477
+ readonly getDeliveryMetricsHistory: (deliveryId: number) => Promise<LighthouseApiResult<DeliveryMetricsHistory>>;
411
478
  readonly getRecurringBlackoutRules: () => Promise<LighthouseApiResult<readonly RecurringBlackoutRule[]>>;
412
479
  readonly createRecurringBlackoutRule: (payload: LighthouseWritePayload) => Promise<LighthouseApiResult<RecurringBlackoutRule>>;
413
480
  readonly updateRecurringBlackoutRule: (id: number, payload: LighthouseWritePayload) => Promise<LighthouseApiResult<RecurringBlackoutRule>>;
@@ -434,6 +501,7 @@ declare const FEATURE_REQUIRES_SERVER_NEWER_THAN: {
434
501
  readonly blockedCountHistory: "v26.7.3.1";
435
502
  readonly percentilesOverTime: "v26.7.11.4";
436
503
  readonly processBehaviorOverTime: "v26.7.11.4";
504
+ readonly deliveryMetricsHistory: "v26.5.29.5";
437
505
  };
438
506
  /**
439
507
  * Returns true when `candidate` is strictly newer than `baseline`, false when
@@ -443,4 +511,4 @@ declare const FEATURE_REQUIRES_SERVER_NEWER_THAN: {
443
511
  declare const isServerVersionNewerThan: (candidate: string, baseline: string) => boolean | null;
444
512
  declare const createLighthouseClient: (configuration: LighthouseClientConfiguration, dependencies?: LighthouseClientDependencies) => LighthouseClient;
445
513
 
446
- export { type BacktestInput, type BlockedCountSnapshot, type CliAuthSessionPollResult, type CliAuthSessionStartError, type CliAuthSessionStartOutcome, type CliAuthSessionStartResult, type CliConnection, type CliServerAuthMode, type CliServerConnection, type CliStandaloneConnection, type ClientCapability, type ClientPackageContract, type ConnectivityCategory, type ConnectivityDependencies, type ConnectivityFetchResponse, type ConnectivityValidationResult, type CumulativeStateTimeCandidateRow, type CumulativeStateTimeCandidatesResult, type CumulativeStateTimeItemRow, type CumulativeStateTimeItemsResult, type CumulativeStateTimeResult, type CumulativeStateTimeStateRow, type DailyTotalWorkItemAge, type DailyWorkItemAge, type DayOfWeek, FEATURE_REQUIRES_SERVER_NEWER_THAN, type LighthouseApiError, type LighthouseApiResult, type LighthouseAuthContext, type LighthouseAuthOverrides, type LighthouseAuthStatus, type LighthouseAuthStore, type LighthouseClient, type LighthouseClientAuth, type LighthouseClientConfiguration, type LighthouseClientDependencies, type LighthouseConnectionConfiguration, type LighthouseWritePayload, type ManualForecastInput, type MetricsDateRange, type PercentilesOverTimeMetricType, type PercentilesOverTimeSnapshot, type ProcessBehaviorMetricType, type ProcessBehaviorSnapshot, type RecurringBlackoutRule, type RecurringBlackoutRuleInput, type ResolvedLighthouseEndpoint, type ServerAuthModeResult, type StandaloneDiscoveryContract, type StandaloneDiscoveryContractParseResult, type StoredLighthouseAuth, type ThroughputFilterView, type TotalWorkItemAgeOverTimeResult, type WorkItemAgeEntry, type WorkItemAgeOverTimeResult, createLighthouseAuthContext, createLighthouseClient, getClientPackageContract, getDefaultMetricsDateRange, getStandaloneDiscoveryLockfilePath, isServerVersionNewerThan, loadStandaloneDiscoveryContract, parseStandaloneDiscoveryContract, pollCliAuthSession, queryServerAuthMode, startCliAuthSession, validateLighthouseConnectivity };
514
+ export { type BacktestInput, type BlockedCountSnapshot, type CliAuthSessionPollResult, type CliAuthSessionStartError, type CliAuthSessionStartOutcome, type CliAuthSessionStartResult, type CliConnection, type CliServerAuthMode, type CliServerConnection, type CliStandaloneConnection, type ClientCapability, type ClientPackageContract, type ConnectivityCategory, type ConnectivityDependencies, type ConnectivityFetchResponse, type ConnectivityValidationResult, type CumulativeStateTimeCandidateRow, type CumulativeStateTimeCandidatesResult, type CumulativeStateTimeItemRow, type CumulativeStateTimeItemsResult, type CumulativeStateTimeResult, type CumulativeStateTimeStateRow, type DailyTotalWorkItemAge, type DailyWorkItemAge, type DayOfWeek, type DeliveryFeatureMetric, type DeliveryMetricsHistory, type DeliveryMetricsHistoryPoint, type DeliveryMetricsHistorySummaryRow, type DeliveryWhenDistributionPoint, FEATURE_REQUIRES_SERVER_NEWER_THAN, type LighthouseApiError, type LighthouseApiResult, type LighthouseAuthContext, type LighthouseAuthOverrides, type LighthouseAuthStatus, type LighthouseAuthStore, type LighthouseClient, type LighthouseClientAuth, type LighthouseClientConfiguration, type LighthouseClientDependencies, type LighthouseConnectionConfiguration, type LighthouseWritePayload, type ManualForecastInput, type MetricsDateRange, type PercentilesOverTimeMetricType, type PercentilesOverTimeSnapshot, type ProcessBehaviorMetricType, type ProcessBehaviorSnapshot, type RecurringBlackoutRule, type RecurringBlackoutRuleInput, type ResolvedLighthouseEndpoint, type ServerAuthModeResult, type StandaloneDiscoveryContract, type StandaloneDiscoveryContractParseResult, type StoredLighthouseAuth, type ThroughputFilterView, type TotalWorkItemAgeOverTimeResult, type WorkItemAgeEntry, type WorkItemAgeOverTimeResult, createLighthouseAuthContext, createLighthouseClient, getClientPackageContract, getDefaultMetricsDateRange, getStandaloneDiscoveryLockfilePath, isServerVersionNewerThan, loadStandaloneDiscoveryContract, parseStandaloneDiscoveryContract, pollCliAuthSession, queryServerAuthMode, startCliAuthSession, summariseDeliveryMetricsHistory, validateLighthouseConnectivity };
package/dist/index.js CHANGED
@@ -495,6 +495,15 @@ var getDefaultMetricsDateRange = () => {
495
495
  endDate: toIsoDate(end)
496
496
  };
497
497
  };
498
+ var summariseDeliveryMetricsHistory = (history) => history.points.map((point) => ({
499
+ date: point.date,
500
+ totalWork: point.totalWork,
501
+ doneWork: point.doneWork,
502
+ remainingWork: point.remainingWork,
503
+ epicCount: point.featureBreakdown.length,
504
+ estimatedItemCount: point.estimatedItemCount,
505
+ likelihoodPercentage: point.likelihoodPercentage
506
+ }));
498
507
  var getAuthHeaders = (auth) => {
499
508
  if (auth === void 0 || auth.kind === "none") {
500
509
  return {};
@@ -760,7 +769,10 @@ var FEATURE_REQUIRES_SERVER_NEWER_THAN = {
760
769
  mcpOAuthPassThrough: "v26.6.16.14",
761
770
  blockedCountHistory: "v26.7.3.1",
762
771
  percentilesOverTime: "v26.7.11.4",
763
- processBehaviorOverTime: "v26.7.11.4"
772
+ processBehaviorOverTime: "v26.7.11.4",
773
+ // The endpoint landed in v26.6.7.1. The per-epic size fields came much later and are optional on
774
+ // the wire, so a server between the two answers fine — it just reports no sizes.
775
+ deliveryMetricsHistory: "v26.5.29.5"
764
776
  };
765
777
  var parseServerVersion = (raw) => {
766
778
  const trimmed = raw.trim().replace(/^v/iu, "");
@@ -1408,6 +1420,18 @@ var createLighthouseClient = (configuration, dependencies = {}) => {
1408
1420
  `/v1/deliveries/${deliveryId}`,
1409
1421
  { method: "DELETE" }
1410
1422
  ),
1423
+ getDeliveryMetricsHistory: async (deliveryId) => {
1424
+ const unsupported = await ensureServerSupports("deliveryMetricsHistory");
1425
+ if (unsupported) {
1426
+ return unsupported;
1427
+ }
1428
+ return requestJson(
1429
+ configuration,
1430
+ dependencies,
1431
+ `/v1/deliveries/${deliveryId}/metrics-history`,
1432
+ { method: "GET" }
1433
+ );
1434
+ },
1411
1435
  getRecurringBlackoutRules: async () => {
1412
1436
  const unsupported = await ensureServerSupports("recurringBlackoutRules");
1413
1437
  if (unsupported) {
@@ -1483,5 +1507,6 @@ export {
1483
1507
  pollCliAuthSession,
1484
1508
  queryServerAuthMode,
1485
1509
  startCliAuthSession,
1510
+ summariseDeliveryMetricsHistory,
1486
1511
  validateLighthouseConnectivity
1487
1512
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@letpeoplework/lighthouse-client",
3
- "version": "1.7.0",
3
+ "version": "1.8.1",
4
4
  "description": "Shared Lighthouse API client contracts",
5
5
  "repository": "https://github.com/LetPeopleWork/lighthouse-clients",
6
6
  "type": "module",