@letpeoplework/lighthouse-mcp-core 1.0.1 → 1.2.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.cjs CHANGED
@@ -58,6 +58,32 @@ var dateRangeProperties = {
58
58
  description: "Inclusive end date in ISO format (YYYY-MM-DD)."
59
59
  }
60
60
  };
61
+ var throughputFilterViewProperty = {
62
+ view: {
63
+ type: "string",
64
+ enum: ["raw", "filtered"],
65
+ description: `Forecast-filter view (Lighthouse v26.5.24.10+). "filtered" applies the team's exclusion rule to throughput. Omit or "raw" returns unfiltered data.`
66
+ }
67
+ };
68
+ var cumulativeStateProperty = {
69
+ state: {
70
+ type: "string",
71
+ description: "Workflow state name to drill into (must match a bar's state from the cumulativeStateTime response)."
72
+ }
73
+ };
74
+ var itemIdsProperty = {
75
+ itemIds: {
76
+ type: "array",
77
+ items: { type: "integer" },
78
+ description: "Optional work-item IDs to narrow the computation to a selected subset; omit for all in-scope items."
79
+ }
80
+ };
81
+ var forecastFilterOverrideProperty = {
82
+ applyFilterOverride: {
83
+ type: "boolean",
84
+ description: "Override the team's forecast-filter setting (Lighthouse v26.5.24.10+). true = apply the team filter; false = skip the filter (raw); omit = respect the team setting."
85
+ }
86
+ };
61
87
  var toolDefinitions = [
62
88
  {
63
89
  name: "lighthouse_health_check",
@@ -111,12 +137,13 @@ var toolDefinitions = [
111
137
  },
112
138
  {
113
139
  name: "lighthouse_team_metrics_throughput",
114
- description: "Get throughput run-chart data for a team by ID, optionally filtered by start and end dates.",
140
+ description: `Get throughput run-chart data for a team by ID, optionally filtered by start and end dates. Pass view="filtered" to apply the team's forecast-exclusion rule (Lighthouse v26.5.24.10+); omit or "raw" returns unfiltered data.`,
115
141
  inputSchema: {
116
142
  type: "object",
117
143
  properties: {
118
144
  ...idInputSchema.properties,
119
- ...dateRangeProperties
145
+ ...dateRangeProperties,
146
+ ...throughputFilterViewProperty
120
147
  },
121
148
  required: ["id"],
122
149
  additionalProperties: false
@@ -236,7 +263,7 @@ var toolDefinitions = [
236
263
  },
237
264
  {
238
265
  name: "lighthouse_forecast_manual",
239
- description: "Run a manual forecast for a team by ID with optional remaining items and target date.",
266
+ description: "Run a manual forecast for a team by ID with optional remaining items and target date. Pass applyFilterOverride=true to apply the team's forecast filter, false to skip it, or omit to respect the team setting (Lighthouse v26.5.24.10+). The response includes filterApplied (boolean) and excludedSummary (string) when a filter was applied.",
240
267
  inputSchema: {
241
268
  type: "object",
242
269
  properties: {
@@ -248,7 +275,8 @@ var toolDefinitions = [
248
275
  targetDate: {
249
276
  type: "string",
250
277
  description: "Optional target date in ISO format (YYYY-MM-DD)."
251
- }
278
+ },
279
+ ...forecastFilterOverrideProperty
252
280
  },
253
281
  required: ["id"],
254
282
  additionalProperties: false
@@ -256,7 +284,7 @@ var toolDefinitions = [
256
284
  },
257
285
  {
258
286
  name: "lighthouse_forecast_backtest",
259
- description: "Run a forecast backtest for a team by ID using forecast and historical date ranges.",
287
+ description: "Run a forecast backtest for a team by ID using forecast and historical date ranges. Pass applyFilterOverride=true to apply the team's forecast filter, false to skip it, or omit to respect the team setting (Lighthouse v26.5.24.10+). The response includes filterApplied (boolean) and excludedSummary (string) when a filter was applied.",
260
288
  inputSchema: {
261
289
  type: "object",
262
290
  properties: {
@@ -276,7 +304,8 @@ var toolDefinitions = [
276
304
  historicalEndDate: {
277
305
  type: "string",
278
306
  description: "Historical sample end date in ISO format (YYYY-MM-DD)."
279
- }
307
+ },
308
+ ...forecastFilterOverrideProperty
280
309
  },
281
310
  required: [
282
311
  "id",
@@ -287,6 +316,90 @@ var toolDefinitions = [
287
316
  ],
288
317
  additionalProperties: false
289
318
  }
319
+ },
320
+ {
321
+ name: "lighthouse_team_metrics_cumulativeStateTime",
322
+ description: "Get cumulative time-per-state bar data for a team by ID: one entry per Doing-category workflow state with total/completed/ongoing contribution days and item counts. Optionally filter by date range and a subset of work-item IDs.",
323
+ inputSchema: {
324
+ type: "object",
325
+ properties: {
326
+ ...idInputSchema.properties,
327
+ ...dateRangeProperties,
328
+ ...itemIdsProperty
329
+ },
330
+ required: ["id"],
331
+ additionalProperties: false
332
+ }
333
+ },
334
+ {
335
+ name: "lighthouse_team_metrics_cumulativeStateTimeItems",
336
+ description: "Get the per-item drill-down for ONE state of a team's cumulative time-per-state chart: the work items that contributed to that state, with days contributed. Requires the state name.",
337
+ inputSchema: {
338
+ type: "object",
339
+ properties: {
340
+ ...idInputSchema.properties,
341
+ ...cumulativeStateProperty,
342
+ ...dateRangeProperties,
343
+ ...itemIdsProperty
344
+ },
345
+ required: ["id", "state"],
346
+ additionalProperties: false
347
+ }
348
+ },
349
+ {
350
+ name: "lighthouse_team_metrics_cumulativeStateTimeCandidates",
351
+ description: "List the work items selectable in a team's cumulative time-per-state item picker for the window (the in-scope candidate set). Search keys are referenceId and title.",
352
+ inputSchema: {
353
+ type: "object",
354
+ properties: {
355
+ ...idInputSchema.properties,
356
+ ...dateRangeProperties
357
+ },
358
+ required: ["id"],
359
+ additionalProperties: false
360
+ }
361
+ },
362
+ {
363
+ name: "lighthouse_portfolio_metrics_cumulativeStateTime",
364
+ description: "Get cumulative time-per-state bar data for a portfolio by ID: one entry per Doing-category workflow state with total/completed/ongoing contribution days and item counts. Optionally filter by date range and a subset of work-item IDs.",
365
+ inputSchema: {
366
+ type: "object",
367
+ properties: {
368
+ ...idInputSchema.properties,
369
+ ...dateRangeProperties,
370
+ ...itemIdsProperty
371
+ },
372
+ required: ["id"],
373
+ additionalProperties: false
374
+ }
375
+ },
376
+ {
377
+ name: "lighthouse_portfolio_metrics_cumulativeStateTimeItems",
378
+ description: "Get the per-item drill-down for ONE state of a portfolio's cumulative time-per-state chart: the work items that contributed to that state, with days contributed. Requires the state name.",
379
+ inputSchema: {
380
+ type: "object",
381
+ properties: {
382
+ ...idInputSchema.properties,
383
+ ...cumulativeStateProperty,
384
+ ...dateRangeProperties,
385
+ ...itemIdsProperty
386
+ },
387
+ required: ["id", "state"],
388
+ additionalProperties: false
389
+ }
390
+ },
391
+ {
392
+ name: "lighthouse_portfolio_metrics_cumulativeStateTimeCandidates",
393
+ description: "List the work items selectable in a portfolio's cumulative time-per-state item picker for the window (the in-scope candidate set). Search keys are referenceId and title.",
394
+ inputSchema: {
395
+ type: "object",
396
+ properties: {
397
+ ...idInputSchema.properties,
398
+ ...dateRangeProperties
399
+ },
400
+ required: ["id"],
401
+ additionalProperties: false
402
+ }
290
403
  }
291
404
  ];
292
405
  var encodePayload = (value) => {
@@ -338,6 +451,40 @@ var getDateRange = (argumentsPayload) => {
338
451
  }
339
452
  return void 0;
340
453
  };
454
+ var getStringArgument = (argumentsPayload, key) => {
455
+ if (!isObjectRecord(argumentsPayload)) {
456
+ return void 0;
457
+ }
458
+ const value = argumentsPayload[key];
459
+ return typeof value === "string" ? value : void 0;
460
+ };
461
+ var getItemIdsArgument = (argumentsPayload) => {
462
+ if (!isObjectRecord(argumentsPayload)) {
463
+ return void 0;
464
+ }
465
+ const value = argumentsPayload.itemIds;
466
+ if (!Array.isArray(value)) {
467
+ return void 0;
468
+ }
469
+ const ids = value.filter(
470
+ (entry) => typeof entry === "number" && Number.isInteger(entry)
471
+ );
472
+ return ids.length > 0 ? ids : void 0;
473
+ };
474
+ var getThroughputFilterView = (argumentsPayload) => {
475
+ if (!isObjectRecord(argumentsPayload)) {
476
+ return void 0;
477
+ }
478
+ const view = argumentsPayload.view;
479
+ return view === "raw" || view === "filtered" ? view : void 0;
480
+ };
481
+ var getApplyFilterOverride = (argumentsPayload) => {
482
+ if (!isObjectRecord(argumentsPayload)) {
483
+ return void 0;
484
+ }
485
+ const value = argumentsPayload.applyFilterOverride;
486
+ return typeof value === "boolean" ? value : void 0;
487
+ };
341
488
  var isoDateStringSchema = import_zod.z.string().regex(/^\d{4}-\d{2}-\d{2}$/u, "Expected ISO date in YYYY-MM-DD format.");
342
489
  var toolInputSchemas = {
343
490
  lighthouse_health_check: import_zod.z.object({}),
@@ -353,7 +500,8 @@ var toolInputSchemas = {
353
500
  lighthouse_team_metrics_throughput: import_zod.z.object({
354
501
  id: import_zod.z.number().int(),
355
502
  startDate: isoDateStringSchema.optional(),
356
- endDate: isoDateStringSchema.optional()
503
+ endDate: isoDateStringSchema.optional(),
504
+ view: import_zod.z.enum(["raw", "filtered"]).optional()
357
505
  }),
358
506
  lighthouse_team_metrics_cycleTimePercentiles: import_zod.z.object({
359
507
  id: import_zod.z.number().int(),
@@ -385,6 +533,42 @@ var toolInputSchemas = {
385
533
  startDate: isoDateStringSchema.optional(),
386
534
  endDate: isoDateStringSchema.optional()
387
535
  }),
536
+ lighthouse_team_metrics_cumulativeStateTime: import_zod.z.object({
537
+ id: import_zod.z.number().int(),
538
+ startDate: isoDateStringSchema.optional(),
539
+ endDate: isoDateStringSchema.optional(),
540
+ itemIds: import_zod.z.array(import_zod.z.number().int()).optional()
541
+ }),
542
+ lighthouse_team_metrics_cumulativeStateTimeItems: import_zod.z.object({
543
+ id: import_zod.z.number().int(),
544
+ state: import_zod.z.string(),
545
+ startDate: isoDateStringSchema.optional(),
546
+ endDate: isoDateStringSchema.optional(),
547
+ itemIds: import_zod.z.array(import_zod.z.number().int()).optional()
548
+ }),
549
+ lighthouse_team_metrics_cumulativeStateTimeCandidates: import_zod.z.object({
550
+ id: import_zod.z.number().int(),
551
+ startDate: isoDateStringSchema.optional(),
552
+ endDate: isoDateStringSchema.optional()
553
+ }),
554
+ lighthouse_portfolio_metrics_cumulativeStateTime: import_zod.z.object({
555
+ id: import_zod.z.number().int(),
556
+ startDate: isoDateStringSchema.optional(),
557
+ endDate: isoDateStringSchema.optional(),
558
+ itemIds: import_zod.z.array(import_zod.z.number().int()).optional()
559
+ }),
560
+ lighthouse_portfolio_metrics_cumulativeStateTimeItems: import_zod.z.object({
561
+ id: import_zod.z.number().int(),
562
+ state: import_zod.z.string(),
563
+ startDate: isoDateStringSchema.optional(),
564
+ endDate: isoDateStringSchema.optional(),
565
+ itemIds: import_zod.z.array(import_zod.z.number().int()).optional()
566
+ }),
567
+ lighthouse_portfolio_metrics_cumulativeStateTimeCandidates: import_zod.z.object({
568
+ id: import_zod.z.number().int(),
569
+ startDate: isoDateStringSchema.optional(),
570
+ endDate: isoDateStringSchema.optional()
571
+ }),
388
572
  lighthouse_feature_get: import_zod.z.object({
389
573
  ids: import_zod.z.array(import_zod.z.number().int()).optional(),
390
574
  refs: import_zod.z.array(import_zod.z.string()).optional()
@@ -394,14 +578,16 @@ var toolInputSchemas = {
394
578
  lighthouse_forecast_manual: import_zod.z.object({
395
579
  id: import_zod.z.number().int(),
396
580
  remainingItems: import_zod.z.number().int().optional(),
397
- targetDate: isoDateStringSchema.optional()
581
+ targetDate: isoDateStringSchema.optional(),
582
+ applyFilterOverride: import_zod.z.boolean().optional()
398
583
  }),
399
584
  lighthouse_forecast_backtest: import_zod.z.object({
400
585
  id: import_zod.z.number().int(),
401
586
  startDate: isoDateStringSchema,
402
587
  endDate: isoDateStringSchema,
403
588
  historicalStartDate: isoDateStringSchema,
404
- historicalEndDate: isoDateStringSchema
589
+ historicalEndDate: isoDateStringSchema,
590
+ applyFilterOverride: import_zod.z.boolean().optional()
405
591
  })
406
592
  };
407
593
  var isReadOnlyTool = (toolName) => !toolName.endsWith("_refresh");
@@ -534,7 +720,8 @@ var createMcpCoreRuntime = (dependencies) => ({
534
720
  return getErrorToolResult("team metrics: invalid id");
535
721
  }
536
722
  const range = getDateRange(argumentsPayload);
537
- const result = await client.getTeamThroughput(id, range);
723
+ const view = getThroughputFilterView(argumentsPayload);
724
+ const result = await client.getTeamThroughput(id, range, view);
538
725
  if (result.ok) {
539
726
  return getSuccessToolResult(
540
727
  `team throughput: ${encodePayload(result.value)}`
@@ -560,6 +747,128 @@ var createMcpCoreRuntime = (dependencies) => ({
560
747
  `team metrics: ${result.error.category} (${result.error.reason})`
561
748
  );
562
749
  }
750
+ if (name === "lighthouse_team_metrics_cumulativeStateTime") {
751
+ const id = getNumericId(argumentsPayload);
752
+ if (id === null) {
753
+ return getErrorToolResult("team metrics: invalid id");
754
+ }
755
+ const result = await client.getTeamCumulativeStateTime(
756
+ id,
757
+ getDateRange(argumentsPayload),
758
+ getItemIdsArgument(argumentsPayload)
759
+ );
760
+ if (result.ok) {
761
+ return getSuccessToolResult(
762
+ `team cumulativeStateTime: ${encodePayload(result.value)}`
763
+ );
764
+ }
765
+ return getErrorToolResult(
766
+ `team metrics: ${result.error.category} (${result.error.reason})`
767
+ );
768
+ }
769
+ if (name === "lighthouse_team_metrics_cumulativeStateTimeItems") {
770
+ const id = getNumericId(argumentsPayload);
771
+ if (id === null) {
772
+ return getErrorToolResult("team metrics: invalid id");
773
+ }
774
+ const state = getStringArgument(argumentsPayload, "state");
775
+ if (state === void 0) {
776
+ return getErrorToolResult("team metrics: missing state");
777
+ }
778
+ const result = await client.getTeamCumulativeStateTimeItems(
779
+ id,
780
+ state,
781
+ getDateRange(argumentsPayload),
782
+ getItemIdsArgument(argumentsPayload)
783
+ );
784
+ if (result.ok) {
785
+ return getSuccessToolResult(
786
+ `team cumulativeStateTimeItems: ${encodePayload(result.value)}`
787
+ );
788
+ }
789
+ return getErrorToolResult(
790
+ `team metrics: ${result.error.category} (${result.error.reason})`
791
+ );
792
+ }
793
+ if (name === "lighthouse_team_metrics_cumulativeStateTimeCandidates") {
794
+ const id = getNumericId(argumentsPayload);
795
+ if (id === null) {
796
+ return getErrorToolResult("team metrics: invalid id");
797
+ }
798
+ const result = await client.getTeamCumulativeStateTimeCandidates(
799
+ id,
800
+ getDateRange(argumentsPayload)
801
+ );
802
+ if (result.ok) {
803
+ return getSuccessToolResult(
804
+ `team cumulativeStateTimeCandidates: ${encodePayload(result.value)}`
805
+ );
806
+ }
807
+ return getErrorToolResult(
808
+ `team metrics: ${result.error.category} (${result.error.reason})`
809
+ );
810
+ }
811
+ if (name === "lighthouse_portfolio_metrics_cumulativeStateTime") {
812
+ const id = getNumericId(argumentsPayload);
813
+ if (id === null) {
814
+ return getErrorToolResult("portfolio metrics: invalid id");
815
+ }
816
+ const result = await client.getPortfolioCumulativeStateTime(
817
+ id,
818
+ getDateRange(argumentsPayload),
819
+ getItemIdsArgument(argumentsPayload)
820
+ );
821
+ if (result.ok) {
822
+ return getSuccessToolResult(
823
+ `portfolio cumulativeStateTime: ${encodePayload(result.value)}`
824
+ );
825
+ }
826
+ return getErrorToolResult(
827
+ `portfolio metrics: ${result.error.category} (${result.error.reason})`
828
+ );
829
+ }
830
+ if (name === "lighthouse_portfolio_metrics_cumulativeStateTimeItems") {
831
+ const id = getNumericId(argumentsPayload);
832
+ if (id === null) {
833
+ return getErrorToolResult("portfolio metrics: invalid id");
834
+ }
835
+ const state = getStringArgument(argumentsPayload, "state");
836
+ if (state === void 0) {
837
+ return getErrorToolResult("portfolio metrics: missing state");
838
+ }
839
+ const result = await client.getPortfolioCumulativeStateTimeItems(
840
+ id,
841
+ state,
842
+ getDateRange(argumentsPayload),
843
+ getItemIdsArgument(argumentsPayload)
844
+ );
845
+ if (result.ok) {
846
+ return getSuccessToolResult(
847
+ `portfolio cumulativeStateTimeItems: ${encodePayload(result.value)}`
848
+ );
849
+ }
850
+ return getErrorToolResult(
851
+ `portfolio metrics: ${result.error.category} (${result.error.reason})`
852
+ );
853
+ }
854
+ if (name === "lighthouse_portfolio_metrics_cumulativeStateTimeCandidates") {
855
+ const id = getNumericId(argumentsPayload);
856
+ if (id === null) {
857
+ return getErrorToolResult("portfolio metrics: invalid id");
858
+ }
859
+ const result = await client.getPortfolioCumulativeStateTimeCandidates(
860
+ id,
861
+ getDateRange(argumentsPayload)
862
+ );
863
+ if (result.ok) {
864
+ return getSuccessToolResult(
865
+ `portfolio cumulativeStateTimeCandidates: ${encodePayload(result.value)}`
866
+ );
867
+ }
868
+ return getErrorToolResult(
869
+ `portfolio metrics: ${result.error.category} (${result.error.reason})`
870
+ );
871
+ }
563
872
  if (name === "lighthouse_portfolio_metrics_throughput") {
564
873
  const id = getNumericId(argumentsPayload);
565
874
  if (id === null) {
@@ -717,9 +1026,11 @@ var createMcpCoreRuntime = (dependencies) => ({
717
1026
  const payload = isObjectRecord(argumentsPayload) ? argumentsPayload : {};
718
1027
  const remainingItems = typeof payload.remainingItems === "number" ? payload.remainingItems : void 0;
719
1028
  const targetDate = typeof payload.targetDate === "string" ? payload.targetDate : void 0;
1029
+ const applyFilterOverride = getApplyFilterOverride(argumentsPayload);
720
1030
  const result = await client.runManualForecast(id, {
721
1031
  remainingItems,
722
- targetDate
1032
+ targetDate,
1033
+ applyFilterOverride
723
1034
  });
724
1035
  if (result.ok) {
725
1036
  return getSuccessToolResult(`forecast: ${encodePayload(result.value)}`);
@@ -743,11 +1054,13 @@ var createMcpCoreRuntime = (dependencies) => ({
743
1054
  "backtest: startDate, endDate, historicalStartDate, and historicalEndDate are required"
744
1055
  );
745
1056
  }
1057
+ const applyFilterOverride = getApplyFilterOverride(argumentsPayload);
746
1058
  const result = await client.runBacktest(id, {
747
1059
  startDate,
748
1060
  endDate,
749
1061
  historicalStartDate,
750
- historicalEndDate
1062
+ historicalEndDate,
1063
+ applyFilterOverride
751
1064
  });
752
1065
  if (result.ok) {
753
1066
  return getSuccessToolResult(`backtest: ${encodePayload(result.value)}`);
package/dist/index.d.cts CHANGED
@@ -15,7 +15,7 @@ type McpToolResult = {
15
15
  readonly content: readonly McpToolContent[];
16
16
  };
17
17
  type McpToolDefinition = {
18
- readonly name: "lighthouse_health_check" | "lighthouse_version_get" | "lighthouse_worktracking_list" | "lighthouse_worktracking_get" | "lighthouse_team_list" | "lighthouse_team_get" | "lighthouse_team_refresh" | "lighthouse_portfolio_list" | "lighthouse_portfolio_get" | "lighthouse_portfolio_refresh" | "lighthouse_team_metrics_throughput" | "lighthouse_team_metrics_cycleTimePercentiles" | "lighthouse_team_metrics_workItemAge" | "lighthouse_team_metrics_totalWorkItemAge" | "lighthouse_portfolio_metrics_throughput" | "lighthouse_portfolio_metrics_workItemAge" | "lighthouse_portfolio_metrics_totalWorkItemAge" | "lighthouse_feature_get" | "lighthouse_feature_workitems" | "lighthouse_delivery_list" | "lighthouse_forecast_manual" | "lighthouse_forecast_backtest";
18
+ readonly name: "lighthouse_health_check" | "lighthouse_version_get" | "lighthouse_worktracking_list" | "lighthouse_worktracking_get" | "lighthouse_team_list" | "lighthouse_team_get" | "lighthouse_team_refresh" | "lighthouse_portfolio_list" | "lighthouse_portfolio_get" | "lighthouse_portfolio_refresh" | "lighthouse_team_metrics_throughput" | "lighthouse_team_metrics_cycleTimePercentiles" | "lighthouse_team_metrics_workItemAge" | "lighthouse_team_metrics_totalWorkItemAge" | "lighthouse_portfolio_metrics_throughput" | "lighthouse_portfolio_metrics_workItemAge" | "lighthouse_portfolio_metrics_totalWorkItemAge" | "lighthouse_team_metrics_cumulativeStateTime" | "lighthouse_team_metrics_cumulativeStateTimeItems" | "lighthouse_team_metrics_cumulativeStateTimeCandidates" | "lighthouse_portfolio_metrics_cumulativeStateTime" | "lighthouse_portfolio_metrics_cumulativeStateTimeItems" | "lighthouse_portfolio_metrics_cumulativeStateTimeCandidates" | "lighthouse_feature_get" | "lighthouse_feature_workitems" | "lighthouse_delivery_list" | "lighthouse_forecast_manual" | "lighthouse_forecast_backtest";
19
19
  readonly description: string;
20
20
  readonly inputSchema: {
21
21
  readonly type: "object";
@@ -122,7 +122,7 @@ type McpRuntimeClient = {
122
122
  readonly getTeamThroughput: (id: number, range?: {
123
123
  readonly startDate: string;
124
124
  readonly endDate: string;
125
- }) => Promise<{
125
+ }, view?: "raw" | "filtered") => Promise<{
126
126
  readonly ok: true;
127
127
  readonly value: unknown;
128
128
  } | {
@@ -210,6 +210,84 @@ type McpRuntimeClient = {
210
210
  readonly reason: string;
211
211
  };
212
212
  }>;
213
+ readonly getTeamCumulativeStateTime: (id: number, range?: {
214
+ readonly startDate: string;
215
+ readonly endDate: string;
216
+ }, itemIds?: readonly number[]) => Promise<{
217
+ readonly ok: true;
218
+ readonly value: unknown;
219
+ } | {
220
+ readonly ok: false;
221
+ readonly error: {
222
+ readonly category: string;
223
+ readonly reason: string;
224
+ };
225
+ }>;
226
+ readonly getTeamCumulativeStateTimeItems: (id: number, state: string, range?: {
227
+ readonly startDate: string;
228
+ readonly endDate: string;
229
+ }, itemIds?: readonly number[]) => Promise<{
230
+ readonly ok: true;
231
+ readonly value: unknown;
232
+ } | {
233
+ readonly ok: false;
234
+ readonly error: {
235
+ readonly category: string;
236
+ readonly reason: string;
237
+ };
238
+ }>;
239
+ readonly getTeamCumulativeStateTimeCandidates: (id: number, range?: {
240
+ readonly startDate: string;
241
+ readonly endDate: string;
242
+ }) => Promise<{
243
+ readonly ok: true;
244
+ readonly value: unknown;
245
+ } | {
246
+ readonly ok: false;
247
+ readonly error: {
248
+ readonly category: string;
249
+ readonly reason: string;
250
+ };
251
+ }>;
252
+ readonly getPortfolioCumulativeStateTime: (id: number, range?: {
253
+ readonly startDate: string;
254
+ readonly endDate: string;
255
+ }, itemIds?: readonly number[]) => Promise<{
256
+ readonly ok: true;
257
+ readonly value: unknown;
258
+ } | {
259
+ readonly ok: false;
260
+ readonly error: {
261
+ readonly category: string;
262
+ readonly reason: string;
263
+ };
264
+ }>;
265
+ readonly getPortfolioCumulativeStateTimeItems: (id: number, state: string, range?: {
266
+ readonly startDate: string;
267
+ readonly endDate: string;
268
+ }, itemIds?: readonly number[]) => Promise<{
269
+ readonly ok: true;
270
+ readonly value: unknown;
271
+ } | {
272
+ readonly ok: false;
273
+ readonly error: {
274
+ readonly category: string;
275
+ readonly reason: string;
276
+ };
277
+ }>;
278
+ readonly getPortfolioCumulativeStateTimeCandidates: (id: number, range?: {
279
+ readonly startDate: string;
280
+ readonly endDate: string;
281
+ }) => Promise<{
282
+ readonly ok: true;
283
+ readonly value: unknown;
284
+ } | {
285
+ readonly ok: false;
286
+ readonly error: {
287
+ readonly category: string;
288
+ readonly reason: string;
289
+ };
290
+ }>;
213
291
  readonly getFeaturesByIds: (ids: readonly number[]) => Promise<{
214
292
  readonly ok: true;
215
293
  readonly value: readonly unknown[];
@@ -283,6 +361,7 @@ type McpRuntimeClient = {
283
361
  readonly runManualForecast: (teamId: number, payload: {
284
362
  readonly remainingItems?: number;
285
363
  readonly targetDate?: string;
364
+ readonly applyFilterOverride?: boolean;
286
365
  }) => Promise<{
287
366
  readonly ok: true;
288
367
  readonly value: unknown;
@@ -298,6 +377,7 @@ type McpRuntimeClient = {
298
377
  readonly endDate: string;
299
378
  readonly historicalStartDate: string;
300
379
  readonly historicalEndDate: string;
380
+ readonly applyFilterOverride?: boolean;
301
381
  }) => Promise<{
302
382
  readonly ok: true;
303
383
  readonly value: unknown;
package/dist/index.d.ts CHANGED
@@ -15,7 +15,7 @@ type McpToolResult = {
15
15
  readonly content: readonly McpToolContent[];
16
16
  };
17
17
  type McpToolDefinition = {
18
- readonly name: "lighthouse_health_check" | "lighthouse_version_get" | "lighthouse_worktracking_list" | "lighthouse_worktracking_get" | "lighthouse_team_list" | "lighthouse_team_get" | "lighthouse_team_refresh" | "lighthouse_portfolio_list" | "lighthouse_portfolio_get" | "lighthouse_portfolio_refresh" | "lighthouse_team_metrics_throughput" | "lighthouse_team_metrics_cycleTimePercentiles" | "lighthouse_team_metrics_workItemAge" | "lighthouse_team_metrics_totalWorkItemAge" | "lighthouse_portfolio_metrics_throughput" | "lighthouse_portfolio_metrics_workItemAge" | "lighthouse_portfolio_metrics_totalWorkItemAge" | "lighthouse_feature_get" | "lighthouse_feature_workitems" | "lighthouse_delivery_list" | "lighthouse_forecast_manual" | "lighthouse_forecast_backtest";
18
+ readonly name: "lighthouse_health_check" | "lighthouse_version_get" | "lighthouse_worktracking_list" | "lighthouse_worktracking_get" | "lighthouse_team_list" | "lighthouse_team_get" | "lighthouse_team_refresh" | "lighthouse_portfolio_list" | "lighthouse_portfolio_get" | "lighthouse_portfolio_refresh" | "lighthouse_team_metrics_throughput" | "lighthouse_team_metrics_cycleTimePercentiles" | "lighthouse_team_metrics_workItemAge" | "lighthouse_team_metrics_totalWorkItemAge" | "lighthouse_portfolio_metrics_throughput" | "lighthouse_portfolio_metrics_workItemAge" | "lighthouse_portfolio_metrics_totalWorkItemAge" | "lighthouse_team_metrics_cumulativeStateTime" | "lighthouse_team_metrics_cumulativeStateTimeItems" | "lighthouse_team_metrics_cumulativeStateTimeCandidates" | "lighthouse_portfolio_metrics_cumulativeStateTime" | "lighthouse_portfolio_metrics_cumulativeStateTimeItems" | "lighthouse_portfolio_metrics_cumulativeStateTimeCandidates" | "lighthouse_feature_get" | "lighthouse_feature_workitems" | "lighthouse_delivery_list" | "lighthouse_forecast_manual" | "lighthouse_forecast_backtest";
19
19
  readonly description: string;
20
20
  readonly inputSchema: {
21
21
  readonly type: "object";
@@ -122,7 +122,7 @@ type McpRuntimeClient = {
122
122
  readonly getTeamThroughput: (id: number, range?: {
123
123
  readonly startDate: string;
124
124
  readonly endDate: string;
125
- }) => Promise<{
125
+ }, view?: "raw" | "filtered") => Promise<{
126
126
  readonly ok: true;
127
127
  readonly value: unknown;
128
128
  } | {
@@ -210,6 +210,84 @@ type McpRuntimeClient = {
210
210
  readonly reason: string;
211
211
  };
212
212
  }>;
213
+ readonly getTeamCumulativeStateTime: (id: number, range?: {
214
+ readonly startDate: string;
215
+ readonly endDate: string;
216
+ }, itemIds?: readonly number[]) => Promise<{
217
+ readonly ok: true;
218
+ readonly value: unknown;
219
+ } | {
220
+ readonly ok: false;
221
+ readonly error: {
222
+ readonly category: string;
223
+ readonly reason: string;
224
+ };
225
+ }>;
226
+ readonly getTeamCumulativeStateTimeItems: (id: number, state: string, range?: {
227
+ readonly startDate: string;
228
+ readonly endDate: string;
229
+ }, itemIds?: readonly number[]) => Promise<{
230
+ readonly ok: true;
231
+ readonly value: unknown;
232
+ } | {
233
+ readonly ok: false;
234
+ readonly error: {
235
+ readonly category: string;
236
+ readonly reason: string;
237
+ };
238
+ }>;
239
+ readonly getTeamCumulativeStateTimeCandidates: (id: number, range?: {
240
+ readonly startDate: string;
241
+ readonly endDate: string;
242
+ }) => Promise<{
243
+ readonly ok: true;
244
+ readonly value: unknown;
245
+ } | {
246
+ readonly ok: false;
247
+ readonly error: {
248
+ readonly category: string;
249
+ readonly reason: string;
250
+ };
251
+ }>;
252
+ readonly getPortfolioCumulativeStateTime: (id: number, range?: {
253
+ readonly startDate: string;
254
+ readonly endDate: string;
255
+ }, itemIds?: readonly number[]) => Promise<{
256
+ readonly ok: true;
257
+ readonly value: unknown;
258
+ } | {
259
+ readonly ok: false;
260
+ readonly error: {
261
+ readonly category: string;
262
+ readonly reason: string;
263
+ };
264
+ }>;
265
+ readonly getPortfolioCumulativeStateTimeItems: (id: number, state: string, range?: {
266
+ readonly startDate: string;
267
+ readonly endDate: string;
268
+ }, itemIds?: readonly number[]) => Promise<{
269
+ readonly ok: true;
270
+ readonly value: unknown;
271
+ } | {
272
+ readonly ok: false;
273
+ readonly error: {
274
+ readonly category: string;
275
+ readonly reason: string;
276
+ };
277
+ }>;
278
+ readonly getPortfolioCumulativeStateTimeCandidates: (id: number, range?: {
279
+ readonly startDate: string;
280
+ readonly endDate: string;
281
+ }) => Promise<{
282
+ readonly ok: true;
283
+ readonly value: unknown;
284
+ } | {
285
+ readonly ok: false;
286
+ readonly error: {
287
+ readonly category: string;
288
+ readonly reason: string;
289
+ };
290
+ }>;
213
291
  readonly getFeaturesByIds: (ids: readonly number[]) => Promise<{
214
292
  readonly ok: true;
215
293
  readonly value: readonly unknown[];
@@ -283,6 +361,7 @@ type McpRuntimeClient = {
283
361
  readonly runManualForecast: (teamId: number, payload: {
284
362
  readonly remainingItems?: number;
285
363
  readonly targetDate?: string;
364
+ readonly applyFilterOverride?: boolean;
286
365
  }) => Promise<{
287
366
  readonly ok: true;
288
367
  readonly value: unknown;
@@ -298,6 +377,7 @@ type McpRuntimeClient = {
298
377
  readonly endDate: string;
299
378
  readonly historicalStartDate: string;
300
379
  readonly historicalEndDate: string;
380
+ readonly applyFilterOverride?: boolean;
301
381
  }) => Promise<{
302
382
  readonly ok: true;
303
383
  readonly value: unknown;
package/dist/index.js CHANGED
@@ -32,6 +32,32 @@ var dateRangeProperties = {
32
32
  description: "Inclusive end date in ISO format (YYYY-MM-DD)."
33
33
  }
34
34
  };
35
+ var throughputFilterViewProperty = {
36
+ view: {
37
+ type: "string",
38
+ enum: ["raw", "filtered"],
39
+ description: `Forecast-filter view (Lighthouse v26.5.24.10+). "filtered" applies the team's exclusion rule to throughput. Omit or "raw" returns unfiltered data.`
40
+ }
41
+ };
42
+ var cumulativeStateProperty = {
43
+ state: {
44
+ type: "string",
45
+ description: "Workflow state name to drill into (must match a bar's state from the cumulativeStateTime response)."
46
+ }
47
+ };
48
+ var itemIdsProperty = {
49
+ itemIds: {
50
+ type: "array",
51
+ items: { type: "integer" },
52
+ description: "Optional work-item IDs to narrow the computation to a selected subset; omit for all in-scope items."
53
+ }
54
+ };
55
+ var forecastFilterOverrideProperty = {
56
+ applyFilterOverride: {
57
+ type: "boolean",
58
+ description: "Override the team's forecast-filter setting (Lighthouse v26.5.24.10+). true = apply the team filter; false = skip the filter (raw); omit = respect the team setting."
59
+ }
60
+ };
35
61
  var toolDefinitions = [
36
62
  {
37
63
  name: "lighthouse_health_check",
@@ -85,12 +111,13 @@ var toolDefinitions = [
85
111
  },
86
112
  {
87
113
  name: "lighthouse_team_metrics_throughput",
88
- description: "Get throughput run-chart data for a team by ID, optionally filtered by start and end dates.",
114
+ description: `Get throughput run-chart data for a team by ID, optionally filtered by start and end dates. Pass view="filtered" to apply the team's forecast-exclusion rule (Lighthouse v26.5.24.10+); omit or "raw" returns unfiltered data.`,
89
115
  inputSchema: {
90
116
  type: "object",
91
117
  properties: {
92
118
  ...idInputSchema.properties,
93
- ...dateRangeProperties
119
+ ...dateRangeProperties,
120
+ ...throughputFilterViewProperty
94
121
  },
95
122
  required: ["id"],
96
123
  additionalProperties: false
@@ -210,7 +237,7 @@ var toolDefinitions = [
210
237
  },
211
238
  {
212
239
  name: "lighthouse_forecast_manual",
213
- description: "Run a manual forecast for a team by ID with optional remaining items and target date.",
240
+ description: "Run a manual forecast for a team by ID with optional remaining items and target date. Pass applyFilterOverride=true to apply the team's forecast filter, false to skip it, or omit to respect the team setting (Lighthouse v26.5.24.10+). The response includes filterApplied (boolean) and excludedSummary (string) when a filter was applied.",
214
241
  inputSchema: {
215
242
  type: "object",
216
243
  properties: {
@@ -222,7 +249,8 @@ var toolDefinitions = [
222
249
  targetDate: {
223
250
  type: "string",
224
251
  description: "Optional target date in ISO format (YYYY-MM-DD)."
225
- }
252
+ },
253
+ ...forecastFilterOverrideProperty
226
254
  },
227
255
  required: ["id"],
228
256
  additionalProperties: false
@@ -230,7 +258,7 @@ var toolDefinitions = [
230
258
  },
231
259
  {
232
260
  name: "lighthouse_forecast_backtest",
233
- description: "Run a forecast backtest for a team by ID using forecast and historical date ranges.",
261
+ description: "Run a forecast backtest for a team by ID using forecast and historical date ranges. Pass applyFilterOverride=true to apply the team's forecast filter, false to skip it, or omit to respect the team setting (Lighthouse v26.5.24.10+). The response includes filterApplied (boolean) and excludedSummary (string) when a filter was applied.",
234
262
  inputSchema: {
235
263
  type: "object",
236
264
  properties: {
@@ -250,7 +278,8 @@ var toolDefinitions = [
250
278
  historicalEndDate: {
251
279
  type: "string",
252
280
  description: "Historical sample end date in ISO format (YYYY-MM-DD)."
253
- }
281
+ },
282
+ ...forecastFilterOverrideProperty
254
283
  },
255
284
  required: [
256
285
  "id",
@@ -261,6 +290,90 @@ var toolDefinitions = [
261
290
  ],
262
291
  additionalProperties: false
263
292
  }
293
+ },
294
+ {
295
+ name: "lighthouse_team_metrics_cumulativeStateTime",
296
+ description: "Get cumulative time-per-state bar data for a team by ID: one entry per Doing-category workflow state with total/completed/ongoing contribution days and item counts. Optionally filter by date range and a subset of work-item IDs.",
297
+ inputSchema: {
298
+ type: "object",
299
+ properties: {
300
+ ...idInputSchema.properties,
301
+ ...dateRangeProperties,
302
+ ...itemIdsProperty
303
+ },
304
+ required: ["id"],
305
+ additionalProperties: false
306
+ }
307
+ },
308
+ {
309
+ name: "lighthouse_team_metrics_cumulativeStateTimeItems",
310
+ description: "Get the per-item drill-down for ONE state of a team's cumulative time-per-state chart: the work items that contributed to that state, with days contributed. Requires the state name.",
311
+ inputSchema: {
312
+ type: "object",
313
+ properties: {
314
+ ...idInputSchema.properties,
315
+ ...cumulativeStateProperty,
316
+ ...dateRangeProperties,
317
+ ...itemIdsProperty
318
+ },
319
+ required: ["id", "state"],
320
+ additionalProperties: false
321
+ }
322
+ },
323
+ {
324
+ name: "lighthouse_team_metrics_cumulativeStateTimeCandidates",
325
+ description: "List the work items selectable in a team's cumulative time-per-state item picker for the window (the in-scope candidate set). Search keys are referenceId and title.",
326
+ inputSchema: {
327
+ type: "object",
328
+ properties: {
329
+ ...idInputSchema.properties,
330
+ ...dateRangeProperties
331
+ },
332
+ required: ["id"],
333
+ additionalProperties: false
334
+ }
335
+ },
336
+ {
337
+ name: "lighthouse_portfolio_metrics_cumulativeStateTime",
338
+ description: "Get cumulative time-per-state bar data for a portfolio by ID: one entry per Doing-category workflow state with total/completed/ongoing contribution days and item counts. Optionally filter by date range and a subset of work-item IDs.",
339
+ inputSchema: {
340
+ type: "object",
341
+ properties: {
342
+ ...idInputSchema.properties,
343
+ ...dateRangeProperties,
344
+ ...itemIdsProperty
345
+ },
346
+ required: ["id"],
347
+ additionalProperties: false
348
+ }
349
+ },
350
+ {
351
+ name: "lighthouse_portfolio_metrics_cumulativeStateTimeItems",
352
+ description: "Get the per-item drill-down for ONE state of a portfolio's cumulative time-per-state chart: the work items that contributed to that state, with days contributed. Requires the state name.",
353
+ inputSchema: {
354
+ type: "object",
355
+ properties: {
356
+ ...idInputSchema.properties,
357
+ ...cumulativeStateProperty,
358
+ ...dateRangeProperties,
359
+ ...itemIdsProperty
360
+ },
361
+ required: ["id", "state"],
362
+ additionalProperties: false
363
+ }
364
+ },
365
+ {
366
+ name: "lighthouse_portfolio_metrics_cumulativeStateTimeCandidates",
367
+ description: "List the work items selectable in a portfolio's cumulative time-per-state item picker for the window (the in-scope candidate set). Search keys are referenceId and title.",
368
+ inputSchema: {
369
+ type: "object",
370
+ properties: {
371
+ ...idInputSchema.properties,
372
+ ...dateRangeProperties
373
+ },
374
+ required: ["id"],
375
+ additionalProperties: false
376
+ }
264
377
  }
265
378
  ];
266
379
  var encodePayload = (value) => {
@@ -312,6 +425,40 @@ var getDateRange = (argumentsPayload) => {
312
425
  }
313
426
  return void 0;
314
427
  };
428
+ var getStringArgument = (argumentsPayload, key) => {
429
+ if (!isObjectRecord(argumentsPayload)) {
430
+ return void 0;
431
+ }
432
+ const value = argumentsPayload[key];
433
+ return typeof value === "string" ? value : void 0;
434
+ };
435
+ var getItemIdsArgument = (argumentsPayload) => {
436
+ if (!isObjectRecord(argumentsPayload)) {
437
+ return void 0;
438
+ }
439
+ const value = argumentsPayload.itemIds;
440
+ if (!Array.isArray(value)) {
441
+ return void 0;
442
+ }
443
+ const ids = value.filter(
444
+ (entry) => typeof entry === "number" && Number.isInteger(entry)
445
+ );
446
+ return ids.length > 0 ? ids : void 0;
447
+ };
448
+ var getThroughputFilterView = (argumentsPayload) => {
449
+ if (!isObjectRecord(argumentsPayload)) {
450
+ return void 0;
451
+ }
452
+ const view = argumentsPayload.view;
453
+ return view === "raw" || view === "filtered" ? view : void 0;
454
+ };
455
+ var getApplyFilterOverride = (argumentsPayload) => {
456
+ if (!isObjectRecord(argumentsPayload)) {
457
+ return void 0;
458
+ }
459
+ const value = argumentsPayload.applyFilterOverride;
460
+ return typeof value === "boolean" ? value : void 0;
461
+ };
315
462
  var isoDateStringSchema = z.string().regex(/^\d{4}-\d{2}-\d{2}$/u, "Expected ISO date in YYYY-MM-DD format.");
316
463
  var toolInputSchemas = {
317
464
  lighthouse_health_check: z.object({}),
@@ -327,7 +474,8 @@ var toolInputSchemas = {
327
474
  lighthouse_team_metrics_throughput: z.object({
328
475
  id: z.number().int(),
329
476
  startDate: isoDateStringSchema.optional(),
330
- endDate: isoDateStringSchema.optional()
477
+ endDate: isoDateStringSchema.optional(),
478
+ view: z.enum(["raw", "filtered"]).optional()
331
479
  }),
332
480
  lighthouse_team_metrics_cycleTimePercentiles: z.object({
333
481
  id: z.number().int(),
@@ -359,6 +507,42 @@ var toolInputSchemas = {
359
507
  startDate: isoDateStringSchema.optional(),
360
508
  endDate: isoDateStringSchema.optional()
361
509
  }),
510
+ lighthouse_team_metrics_cumulativeStateTime: z.object({
511
+ id: z.number().int(),
512
+ startDate: isoDateStringSchema.optional(),
513
+ endDate: isoDateStringSchema.optional(),
514
+ itemIds: z.array(z.number().int()).optional()
515
+ }),
516
+ lighthouse_team_metrics_cumulativeStateTimeItems: z.object({
517
+ id: z.number().int(),
518
+ state: z.string(),
519
+ startDate: isoDateStringSchema.optional(),
520
+ endDate: isoDateStringSchema.optional(),
521
+ itemIds: z.array(z.number().int()).optional()
522
+ }),
523
+ lighthouse_team_metrics_cumulativeStateTimeCandidates: z.object({
524
+ id: z.number().int(),
525
+ startDate: isoDateStringSchema.optional(),
526
+ endDate: isoDateStringSchema.optional()
527
+ }),
528
+ lighthouse_portfolio_metrics_cumulativeStateTime: z.object({
529
+ id: z.number().int(),
530
+ startDate: isoDateStringSchema.optional(),
531
+ endDate: isoDateStringSchema.optional(),
532
+ itemIds: z.array(z.number().int()).optional()
533
+ }),
534
+ lighthouse_portfolio_metrics_cumulativeStateTimeItems: z.object({
535
+ id: z.number().int(),
536
+ state: z.string(),
537
+ startDate: isoDateStringSchema.optional(),
538
+ endDate: isoDateStringSchema.optional(),
539
+ itemIds: z.array(z.number().int()).optional()
540
+ }),
541
+ lighthouse_portfolio_metrics_cumulativeStateTimeCandidates: z.object({
542
+ id: z.number().int(),
543
+ startDate: isoDateStringSchema.optional(),
544
+ endDate: isoDateStringSchema.optional()
545
+ }),
362
546
  lighthouse_feature_get: z.object({
363
547
  ids: z.array(z.number().int()).optional(),
364
548
  refs: z.array(z.string()).optional()
@@ -368,14 +552,16 @@ var toolInputSchemas = {
368
552
  lighthouse_forecast_manual: z.object({
369
553
  id: z.number().int(),
370
554
  remainingItems: z.number().int().optional(),
371
- targetDate: isoDateStringSchema.optional()
555
+ targetDate: isoDateStringSchema.optional(),
556
+ applyFilterOverride: z.boolean().optional()
372
557
  }),
373
558
  lighthouse_forecast_backtest: z.object({
374
559
  id: z.number().int(),
375
560
  startDate: isoDateStringSchema,
376
561
  endDate: isoDateStringSchema,
377
562
  historicalStartDate: isoDateStringSchema,
378
- historicalEndDate: isoDateStringSchema
563
+ historicalEndDate: isoDateStringSchema,
564
+ applyFilterOverride: z.boolean().optional()
379
565
  })
380
566
  };
381
567
  var isReadOnlyTool = (toolName) => !toolName.endsWith("_refresh");
@@ -508,7 +694,8 @@ var createMcpCoreRuntime = (dependencies) => ({
508
694
  return getErrorToolResult("team metrics: invalid id");
509
695
  }
510
696
  const range = getDateRange(argumentsPayload);
511
- const result = await client.getTeamThroughput(id, range);
697
+ const view = getThroughputFilterView(argumentsPayload);
698
+ const result = await client.getTeamThroughput(id, range, view);
512
699
  if (result.ok) {
513
700
  return getSuccessToolResult(
514
701
  `team throughput: ${encodePayload(result.value)}`
@@ -534,6 +721,128 @@ var createMcpCoreRuntime = (dependencies) => ({
534
721
  `team metrics: ${result.error.category} (${result.error.reason})`
535
722
  );
536
723
  }
724
+ if (name === "lighthouse_team_metrics_cumulativeStateTime") {
725
+ const id = getNumericId(argumentsPayload);
726
+ if (id === null) {
727
+ return getErrorToolResult("team metrics: invalid id");
728
+ }
729
+ const result = await client.getTeamCumulativeStateTime(
730
+ id,
731
+ getDateRange(argumentsPayload),
732
+ getItemIdsArgument(argumentsPayload)
733
+ );
734
+ if (result.ok) {
735
+ return getSuccessToolResult(
736
+ `team cumulativeStateTime: ${encodePayload(result.value)}`
737
+ );
738
+ }
739
+ return getErrorToolResult(
740
+ `team metrics: ${result.error.category} (${result.error.reason})`
741
+ );
742
+ }
743
+ if (name === "lighthouse_team_metrics_cumulativeStateTimeItems") {
744
+ const id = getNumericId(argumentsPayload);
745
+ if (id === null) {
746
+ return getErrorToolResult("team metrics: invalid id");
747
+ }
748
+ const state = getStringArgument(argumentsPayload, "state");
749
+ if (state === void 0) {
750
+ return getErrorToolResult("team metrics: missing state");
751
+ }
752
+ const result = await client.getTeamCumulativeStateTimeItems(
753
+ id,
754
+ state,
755
+ getDateRange(argumentsPayload),
756
+ getItemIdsArgument(argumentsPayload)
757
+ );
758
+ if (result.ok) {
759
+ return getSuccessToolResult(
760
+ `team cumulativeStateTimeItems: ${encodePayload(result.value)}`
761
+ );
762
+ }
763
+ return getErrorToolResult(
764
+ `team metrics: ${result.error.category} (${result.error.reason})`
765
+ );
766
+ }
767
+ if (name === "lighthouse_team_metrics_cumulativeStateTimeCandidates") {
768
+ const id = getNumericId(argumentsPayload);
769
+ if (id === null) {
770
+ return getErrorToolResult("team metrics: invalid id");
771
+ }
772
+ const result = await client.getTeamCumulativeStateTimeCandidates(
773
+ id,
774
+ getDateRange(argumentsPayload)
775
+ );
776
+ if (result.ok) {
777
+ return getSuccessToolResult(
778
+ `team cumulativeStateTimeCandidates: ${encodePayload(result.value)}`
779
+ );
780
+ }
781
+ return getErrorToolResult(
782
+ `team metrics: ${result.error.category} (${result.error.reason})`
783
+ );
784
+ }
785
+ if (name === "lighthouse_portfolio_metrics_cumulativeStateTime") {
786
+ const id = getNumericId(argumentsPayload);
787
+ if (id === null) {
788
+ return getErrorToolResult("portfolio metrics: invalid id");
789
+ }
790
+ const result = await client.getPortfolioCumulativeStateTime(
791
+ id,
792
+ getDateRange(argumentsPayload),
793
+ getItemIdsArgument(argumentsPayload)
794
+ );
795
+ if (result.ok) {
796
+ return getSuccessToolResult(
797
+ `portfolio cumulativeStateTime: ${encodePayload(result.value)}`
798
+ );
799
+ }
800
+ return getErrorToolResult(
801
+ `portfolio metrics: ${result.error.category} (${result.error.reason})`
802
+ );
803
+ }
804
+ if (name === "lighthouse_portfolio_metrics_cumulativeStateTimeItems") {
805
+ const id = getNumericId(argumentsPayload);
806
+ if (id === null) {
807
+ return getErrorToolResult("portfolio metrics: invalid id");
808
+ }
809
+ const state = getStringArgument(argumentsPayload, "state");
810
+ if (state === void 0) {
811
+ return getErrorToolResult("portfolio metrics: missing state");
812
+ }
813
+ const result = await client.getPortfolioCumulativeStateTimeItems(
814
+ id,
815
+ state,
816
+ getDateRange(argumentsPayload),
817
+ getItemIdsArgument(argumentsPayload)
818
+ );
819
+ if (result.ok) {
820
+ return getSuccessToolResult(
821
+ `portfolio cumulativeStateTimeItems: ${encodePayload(result.value)}`
822
+ );
823
+ }
824
+ return getErrorToolResult(
825
+ `portfolio metrics: ${result.error.category} (${result.error.reason})`
826
+ );
827
+ }
828
+ if (name === "lighthouse_portfolio_metrics_cumulativeStateTimeCandidates") {
829
+ const id = getNumericId(argumentsPayload);
830
+ if (id === null) {
831
+ return getErrorToolResult("portfolio metrics: invalid id");
832
+ }
833
+ const result = await client.getPortfolioCumulativeStateTimeCandidates(
834
+ id,
835
+ getDateRange(argumentsPayload)
836
+ );
837
+ if (result.ok) {
838
+ return getSuccessToolResult(
839
+ `portfolio cumulativeStateTimeCandidates: ${encodePayload(result.value)}`
840
+ );
841
+ }
842
+ return getErrorToolResult(
843
+ `portfolio metrics: ${result.error.category} (${result.error.reason})`
844
+ );
845
+ }
537
846
  if (name === "lighthouse_portfolio_metrics_throughput") {
538
847
  const id = getNumericId(argumentsPayload);
539
848
  if (id === null) {
@@ -691,9 +1000,11 @@ var createMcpCoreRuntime = (dependencies) => ({
691
1000
  const payload = isObjectRecord(argumentsPayload) ? argumentsPayload : {};
692
1001
  const remainingItems = typeof payload.remainingItems === "number" ? payload.remainingItems : void 0;
693
1002
  const targetDate = typeof payload.targetDate === "string" ? payload.targetDate : void 0;
1003
+ const applyFilterOverride = getApplyFilterOverride(argumentsPayload);
694
1004
  const result = await client.runManualForecast(id, {
695
1005
  remainingItems,
696
- targetDate
1006
+ targetDate,
1007
+ applyFilterOverride
697
1008
  });
698
1009
  if (result.ok) {
699
1010
  return getSuccessToolResult(`forecast: ${encodePayload(result.value)}`);
@@ -717,11 +1028,13 @@ var createMcpCoreRuntime = (dependencies) => ({
717
1028
  "backtest: startDate, endDate, historicalStartDate, and historicalEndDate are required"
718
1029
  );
719
1030
  }
1031
+ const applyFilterOverride = getApplyFilterOverride(argumentsPayload);
720
1032
  const result = await client.runBacktest(id, {
721
1033
  startDate,
722
1034
  endDate,
723
1035
  historicalStartDate,
724
- historicalEndDate
1036
+ historicalEndDate,
1037
+ applyFilterOverride
725
1038
  });
726
1039
  if (result.ok) {
727
1040
  return getSuccessToolResult(`backtest: ${encodePayload(result.value)}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@letpeoplework/lighthouse-mcp-core",
3
- "version": "1.0.1",
3
+ "version": "1.2.0",
4
4
  "description": "Shared MCP semantics for Lighthouse",
5
5
  "repository": "https://github.com/LetPeopleWork/lighthouse-clients",
6
6
  "type": "module",
@@ -26,7 +26,7 @@
26
26
  "@modelcontextprotocol/sdk": "^1.26.0",
27
27
  "@toon-format/toon": "^2.1.0",
28
28
  "zod": "^3.24.1",
29
- "@letpeoplework/lighthouse-client": "1.0.1"
29
+ "@letpeoplework/lighthouse-client": "1.2.0"
30
30
  },
31
31
  "scripts": {
32
32
  "build": "tsup src/index.ts --format esm,cjs --dts --clean",