@thinkai/tai-api-contract 2.62.0 → 2.63.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.
@@ -923,6 +923,46 @@ export interface paths {
923
923
  patch?: never;
924
924
  trace?: never;
925
925
  };
926
+ "/workspaces/{workspaceId}/insights/sdlc/overview": {
927
+ parameters: {
928
+ query?: never;
929
+ header?: never;
930
+ path?: never;
931
+ cookie?: never;
932
+ };
933
+ /**
934
+ * SDLC insights — Engineering Health overview
935
+ * @description Engineering Health dashboard for `/insights/sdlc/overview`. Returns precomputed DORA, CI, collaboration, security, governance, and operational metrics aggregated at calendar-day granularity for the selected window. Filter params mirror other Measure insights routes plus optional `repoIds` scope.
936
+ */
937
+ get: operations["getSdlcInsightsOverview"];
938
+ put?: never;
939
+ post?: never;
940
+ delete?: never;
941
+ options?: never;
942
+ head?: never;
943
+ patch?: never;
944
+ trace?: never;
945
+ };
946
+ "/workspaces/{workspaceId}/insights/sdlc/drilldown/{metricId}": {
947
+ parameters: {
948
+ query?: never;
949
+ header?: never;
950
+ path?: never;
951
+ cookie?: never;
952
+ };
953
+ /**
954
+ * SDLC insights — metric drill-down entities
955
+ * @description Paginated entity list for a single Engineering Health metric (failed workflow runs, PRs, alerts, etc.). Available only when the overview marks `drilldownAvailable: true`.
956
+ */
957
+ get: operations["getSdlcInsightsDrilldown"];
958
+ put?: never;
959
+ post?: never;
960
+ delete?: never;
961
+ options?: never;
962
+ head?: never;
963
+ patch?: never;
964
+ trace?: never;
965
+ };
926
966
  "/workspaces/{workspaceId}/integrations/ai-tool/{provider}/members": {
927
967
  parameters: {
928
968
  query?: never;
@@ -6116,6 +6156,79 @@ export interface components {
6116
6156
  */
6117
6157
  lastSeenAt: string;
6118
6158
  };
6159
+ /** @enum {string} */
6160
+ SdlcModuleId: "dora" | "ci-pipeline" | "collaboration-pr" | "security-risk" | "governance-architecture" | "financial-operational";
6161
+ /** @enum {string} */
6162
+ SdlcMetricId: "dora-deployment-frequency" | "dora-lead-time" | "dora-cfr" | "dora-mttr" | "ci-success-rate" | "ci-duration-p50-p95" | "ci-flakiness" | "ci-queue-wait" | "ci-cache-hit" | "pr-review-time" | "pr-bus-factor" | "pr-size" | "pr-abandonment" | "pr-review-depth" | "pr-draft-duration" | "pr-merge-conflicts" | "pr-commit-density" | "sec-dependabot-backlog" | "sec-vuln-mttr" | "sec-secret-scanning" | "sec-self-approvals" | "sec-unreviewed-merge" | "gov-branch-protection" | "gov-stale-branches" | "gov-orphaned-repos" | "gov-readme-health" | "gov-codeowners" | "gov-issue-pr-linkage" | "fin-gha-minutes" | "fin-copilot-utilization" | "fin-org-inactivity" | "fin-env-drift" | "fin-release-cadence" | "fin-api-rate-limit";
6163
+ /** @enum {string} */
6164
+ SdlcMetricDataStatus: "live" | "preview" | "unavailable";
6165
+ /** @enum {string} */
6166
+ SdlcMetricHealthStatus: "healthy" | "warning" | "critical" | "unknown";
6167
+ /** @enum {string} */
6168
+ SdlcBenchmarkBand: "elite" | "high" | "medium" | "low";
6169
+ SdlcMetricTrendDto: {
6170
+ /** @enum {string} */
6171
+ direction: "up" | "down" | "flat";
6172
+ deltaPercent?: number;
6173
+ };
6174
+ SdlcDailySeriesPointDto: {
6175
+ /**
6176
+ * Format: date
6177
+ * @description Inclusive ISO calendar day (UTC).
6178
+ */
6179
+ date: string;
6180
+ value: number;
6181
+ };
6182
+ SdlcMetricDto: {
6183
+ id: components["schemas"]["SdlcMetricId"];
6184
+ name: string;
6185
+ dataStatus: components["schemas"]["SdlcMetricDataStatus"];
6186
+ healthStatus: components["schemas"]["SdlcMetricHealthStatus"];
6187
+ value: (number | string) | null;
6188
+ unit?: string;
6189
+ secondaryValue?: (number | string) | null;
6190
+ secondaryLabel?: string;
6191
+ trend?: components["schemas"]["SdlcMetricTrendDto"];
6192
+ benchmarkBand?: components["schemas"]["SdlcBenchmarkBand"];
6193
+ drilldownAvailable: boolean;
6194
+ dailySeries?: components["schemas"]["SdlcDailySeriesPointDto"][];
6195
+ unavailableReason?: string;
6196
+ };
6197
+ SdlcModuleDto: {
6198
+ id: components["schemas"]["SdlcModuleId"];
6199
+ name: string;
6200
+ metrics: components["schemas"]["SdlcMetricDto"][];
6201
+ };
6202
+ SdlcOverviewDto: {
6203
+ rangeId: string;
6204
+ /** Format: date */
6205
+ from: string;
6206
+ /** Format: date */
6207
+ to: string;
6208
+ department: string;
6209
+ team: string;
6210
+ repoIds: string[];
6211
+ /** Format: date-time */
6212
+ asOf: string;
6213
+ modules: components["schemas"]["SdlcModuleDto"][];
6214
+ };
6215
+ SdlcDrilldownItemDto: {
6216
+ id: string;
6217
+ title: string;
6218
+ subtitle?: string;
6219
+ /** Format: uri */
6220
+ url?: string;
6221
+ /** Format: date-time */
6222
+ occurredAt?: string;
6223
+ metadata?: {
6224
+ [key: string]: string | number;
6225
+ };
6226
+ };
6227
+ SdlcDrilldownDto: {
6228
+ metricId: components["schemas"]["SdlcMetricId"];
6229
+ items: components["schemas"]["SdlcDrilldownItemDto"][];
6230
+ nextCursor?: string;
6231
+ };
6119
6232
  };
6120
6233
  responses: {
6121
6234
  /** @description Missing or invalid bearer token */
@@ -6169,6 +6282,8 @@ export interface components {
6169
6282
  InsightsProductivityFrom: string;
6170
6283
  /** @description Inclusive end of a daily window (`YYYY-MM-DD`). When set with `from`, overrides `rangeId` for day-mode responses (max 180 days). */
6171
6284
  InsightsProductivityTo: string;
6285
+ /** @description Day-level Measure window. Presets: `7d`, `30d`, `90d`, `180d`. Custom inclusive calendar range: `cr:YYYY-MM-DD:YYYY-MM-DD` (max span 180 days). */
6286
+ InsightsSdlcRangeId: string;
6172
6287
  /** @description Department filter; send `All departments` to include every department. Scoped using imported `thinkai_org_structure` members when present, otherwise SPA org chart `department` nodes and their descendant teams. When neither source defines the requested department, insights return no scoped teams or contributors (not org-wide data). */
6173
6288
  InsightsDepartmentFilter: string;
6174
6289
  /** @description Page size (default 25, max 100). */
@@ -6495,6 +6610,18 @@ export type HrisProviderSyncResultDto = components['schemas']['HrisProviderSyncR
6495
6610
  export type ActivityLogPageDto = components['schemas']['ActivityLogPageDto'];
6496
6611
  export type ReadinessTokenUsageRowDto = components['schemas']['ReadinessTokenUsageRowDto'];
6497
6612
  export type ReadinessTokenUsageByDimensionRowDto = components['schemas']['ReadinessTokenUsageByDimensionRowDto'];
6613
+ export type SdlcModuleId = components['schemas']['SdlcModuleId'];
6614
+ export type SdlcMetricId = components['schemas']['SdlcMetricId'];
6615
+ export type SdlcMetricDataStatus = components['schemas']['SdlcMetricDataStatus'];
6616
+ export type SdlcMetricHealthStatus = components['schemas']['SdlcMetricHealthStatus'];
6617
+ export type SdlcBenchmarkBand = components['schemas']['SdlcBenchmarkBand'];
6618
+ export type SdlcMetricTrendDto = components['schemas']['SdlcMetricTrendDto'];
6619
+ export type SdlcDailySeriesPointDto = components['schemas']['SdlcDailySeriesPointDto'];
6620
+ export type SdlcMetricDto = components['schemas']['SdlcMetricDto'];
6621
+ export type SdlcModuleDto = components['schemas']['SdlcModuleDto'];
6622
+ export type SdlcOverviewDto = components['schemas']['SdlcOverviewDto'];
6623
+ export type SdlcDrilldownItemDto = components['schemas']['SdlcDrilldownItemDto'];
6624
+ export type SdlcDrilldownDto = components['schemas']['SdlcDrilldownDto'];
6498
6625
  export type ResponseUnauthorized = components['responses']['Unauthorized'];
6499
6626
  export type ResponseForbidden = components['responses']['Forbidden'];
6500
6627
  export type ResponseZenHrSyncInProgress = components['responses']['ZenHrSyncInProgress'];
@@ -6509,6 +6636,7 @@ export type ParameterFixId = components['parameters']['FixId'];
6509
6636
  export type ParameterInsightsProductivityRangeId = components['parameters']['InsightsProductivityRangeId'];
6510
6637
  export type ParameterInsightsProductivityFrom = components['parameters']['InsightsProductivityFrom'];
6511
6638
  export type ParameterInsightsProductivityTo = components['parameters']['InsightsProductivityTo'];
6639
+ export type ParameterInsightsSdlcRangeId = components['parameters']['InsightsSdlcRangeId'];
6512
6640
  export type ParameterInsightsDepartmentFilter = components['parameters']['InsightsDepartmentFilter'];
6513
6641
  export type ParameterPaginationLimit = components['parameters']['PaginationLimit'];
6514
6642
  export type ParameterPaginationOffset = components['parameters']['PaginationOffset'];
@@ -9101,6 +9229,112 @@ export interface operations {
9101
9229
  };
9102
9230
  };
9103
9231
  };
9232
+ getSdlcInsightsOverview: {
9233
+ parameters: {
9234
+ query?: {
9235
+ /** @description Day-level Measure window. Presets: `7d`, `30d`, `90d`, `180d`. Custom inclusive calendar range: `cr:YYYY-MM-DD:YYYY-MM-DD` (max span 180 days). */
9236
+ rangeId?: components["parameters"]["InsightsSdlcRangeId"];
9237
+ /** @description Department filter; send `All departments` to include every department. Scoped using imported `thinkai_org_structure` members when present, otherwise SPA org chart `department` nodes and their descendant teams. When neither source defines the requested department, insights return no scoped teams or contributors (not org-wide data). */
9238
+ department?: components["parameters"]["InsightsDepartmentFilter"];
9239
+ /** @description Team name filter; send `All teams` to include every team. */
9240
+ team?: string;
9241
+ /** @description Comma-separated internal repo ids; omit or empty for all repos. */
9242
+ repoIds?: string;
9243
+ };
9244
+ header?: never;
9245
+ path: {
9246
+ workspaceId: components["parameters"]["WorkspaceId"];
9247
+ };
9248
+ cookie?: never;
9249
+ };
9250
+ requestBody?: never;
9251
+ responses: {
9252
+ /** @description Engineering Health overview payload */
9253
+ 200: {
9254
+ headers: {
9255
+ [name: string]: unknown;
9256
+ };
9257
+ content: {
9258
+ "application/json": components["schemas"]["SdlcOverviewDto"];
9259
+ };
9260
+ };
9261
+ /** @description Invalid query parameters */
9262
+ 400: {
9263
+ headers: {
9264
+ [name: string]: unknown;
9265
+ };
9266
+ content: {
9267
+ "application/json": {
9268
+ /** @example invalid_query */
9269
+ error: string;
9270
+ };
9271
+ };
9272
+ };
9273
+ 401: components["responses"]["Unauthorized"];
9274
+ 403: components["responses"]["Forbidden"];
9275
+ /** @description Workspace does not exist or malformed workspaceId */
9276
+ 404: {
9277
+ headers: {
9278
+ [name: string]: unknown;
9279
+ };
9280
+ content?: never;
9281
+ };
9282
+ };
9283
+ };
9284
+ getSdlcInsightsDrilldown: {
9285
+ parameters: {
9286
+ query?: {
9287
+ /** @description Day-level Measure window. Presets: `7d`, `30d`, `90d`, `180d`. Custom inclusive calendar range: `cr:YYYY-MM-DD:YYYY-MM-DD` (max span 180 days). */
9288
+ rangeId?: components["parameters"]["InsightsSdlcRangeId"];
9289
+ /** @description Department filter; send `All departments` to include every department. Scoped using imported `thinkai_org_structure` members when present, otherwise SPA org chart `department` nodes and their descendant teams. When neither source defines the requested department, insights return no scoped teams or contributors (not org-wide data). */
9290
+ department?: components["parameters"]["InsightsDepartmentFilter"];
9291
+ team?: string;
9292
+ repoIds?: string;
9293
+ /** @description Opaque pagination cursor from a prior response. */
9294
+ cursor?: string;
9295
+ limit?: number;
9296
+ };
9297
+ header?: never;
9298
+ path: {
9299
+ workspaceId: components["parameters"]["WorkspaceId"];
9300
+ metricId: components["schemas"]["SdlcMetricId"];
9301
+ };
9302
+ cookie?: never;
9303
+ };
9304
+ requestBody?: never;
9305
+ responses: {
9306
+ /** @description Drill-down page */
9307
+ 200: {
9308
+ headers: {
9309
+ [name: string]: unknown;
9310
+ };
9311
+ content: {
9312
+ "application/json": components["schemas"]["SdlcDrilldownDto"];
9313
+ };
9314
+ };
9315
+ /** @description Invalid query parameters */
9316
+ 400: {
9317
+ headers: {
9318
+ [name: string]: unknown;
9319
+ };
9320
+ content: {
9321
+ "application/json": {
9322
+ /** @example invalid_query */
9323
+ error: string;
9324
+ };
9325
+ };
9326
+ };
9327
+ 401: components["responses"]["Unauthorized"];
9328
+ 403: components["responses"]["Forbidden"];
9329
+ /** @description Workspace or metric not found */
9330
+ 404: {
9331
+ headers: {
9332
+ [name: string]: unknown;
9333
+ };
9334
+ content?: never;
9335
+ };
9336
+ };
9337
+ };
9104
9338
  getAiToolMembers: {
9105
9339
  parameters: {
9106
9340
  query?: {
package/src/index.ts CHANGED
@@ -1423,6 +1423,120 @@ export interface AiToolMemberDetailDto {
1423
1423
  heatmap: AiToolMemberHeatmapDayDto[];
1424
1424
  }
1425
1425
 
1426
+ /** Canonical SDLC Engineering Health module ids. */
1427
+ export const SDL_C_MODULE_IDS = [
1428
+ "dora",
1429
+ "ci-pipeline",
1430
+ "collaboration-pr",
1431
+ "security-risk",
1432
+ "governance-architecture",
1433
+ "financial-operational",
1434
+ ] as const;
1435
+ export type SdlcModuleId = (typeof SDL_C_MODULE_IDS)[number];
1436
+
1437
+ /** Canonical SDLC Engineering Health metric ids (34). */
1438
+ export const SDL_C_METRIC_IDS = [
1439
+ "dora-deployment-frequency",
1440
+ "dora-lead-time",
1441
+ "dora-cfr",
1442
+ "dora-mttr",
1443
+ "ci-success-rate",
1444
+ "ci-duration-p50-p95",
1445
+ "ci-flakiness",
1446
+ "ci-queue-wait",
1447
+ "ci-cache-hit",
1448
+ "pr-review-time",
1449
+ "pr-bus-factor",
1450
+ "pr-size",
1451
+ "pr-abandonment",
1452
+ "pr-review-depth",
1453
+ "pr-draft-duration",
1454
+ "pr-merge-conflicts",
1455
+ "pr-commit-density",
1456
+ "sec-dependabot-backlog",
1457
+ "sec-vuln-mttr",
1458
+ "sec-secret-scanning",
1459
+ "sec-self-approvals",
1460
+ "sec-unreviewed-merge",
1461
+ "gov-branch-protection",
1462
+ "gov-stale-branches",
1463
+ "gov-orphaned-repos",
1464
+ "gov-readme-health",
1465
+ "gov-codeowners",
1466
+ "gov-issue-pr-linkage",
1467
+ "fin-gha-minutes",
1468
+ "fin-copilot-utilization",
1469
+ "fin-org-inactivity",
1470
+ "fin-env-drift",
1471
+ "fin-release-cadence",
1472
+ "fin-api-rate-limit",
1473
+ ] as const;
1474
+ export type SdlcMetricId = (typeof SDL_C_METRIC_IDS)[number];
1475
+
1476
+ export type SdlcMetricDataStatus = "live" | "preview" | "unavailable";
1477
+ export type SdlcMetricHealthStatus = "healthy" | "warning" | "critical" | "unknown";
1478
+ export type SdlcBenchmarkBand = "elite" | "high" | "medium" | "low";
1479
+
1480
+ export interface SdlcMetricTrendDto {
1481
+ direction: "up" | "down" | "flat";
1482
+ deltaPercent?: number;
1483
+ }
1484
+
1485
+ export interface SdlcDailySeriesPointDto {
1486
+ date: string;
1487
+ value: number;
1488
+ }
1489
+
1490
+ export interface SdlcMetricDto {
1491
+ id: SdlcMetricId;
1492
+ name: string;
1493
+ dataStatus: SdlcMetricDataStatus;
1494
+ healthStatus: SdlcMetricHealthStatus;
1495
+ value: number | string | null;
1496
+ unit?: string;
1497
+ secondaryValue?: number | string | null;
1498
+ secondaryLabel?: string;
1499
+ trend?: SdlcMetricTrendDto;
1500
+ benchmarkBand?: SdlcBenchmarkBand;
1501
+ drilldownAvailable: boolean;
1502
+ dailySeries?: SdlcDailySeriesPointDto[];
1503
+ unavailableReason?: string;
1504
+ }
1505
+
1506
+ export interface SdlcModuleDto {
1507
+ id: SdlcModuleId;
1508
+ name: string;
1509
+ metrics: SdlcMetricDto[];
1510
+ }
1511
+
1512
+ /** Response for GET /workspaces/:workspaceId/insights/sdlc/overview */
1513
+ export interface SdlcOverviewDto {
1514
+ rangeId: string;
1515
+ from: string;
1516
+ to: string;
1517
+ department: string;
1518
+ team: string;
1519
+ repoIds: string[];
1520
+ asOf: string;
1521
+ modules: SdlcModuleDto[];
1522
+ }
1523
+
1524
+ export interface SdlcDrilldownItemDto {
1525
+ id: string;
1526
+ title: string;
1527
+ subtitle?: string;
1528
+ url?: string;
1529
+ occurredAt?: string;
1530
+ metadata?: Record<string, string | number>;
1531
+ }
1532
+
1533
+ /** Response for GET /workspaces/:workspaceId/insights/sdlc/drilldown/{metricId} */
1534
+ export interface SdlcDrilldownDto {
1535
+ metricId: SdlcMetricId;
1536
+ items: SdlcDrilldownItemDto[];
1537
+ nextCursor?: string;
1538
+ }
1539
+
1426
1540
  export {
1427
1541
  JOURNEY_STEP_IDS,
1428
1542
  JOURNEY_STEP_REGISTRY,