@thinkai/tai-api-contract 2.35.0 → 2.37.0-pr.798.0cc49094

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.
@@ -425,6 +425,26 @@ export interface paths {
425
425
  patch?: never;
426
426
  trace?: never;
427
427
  };
428
+ "/workspaces/{workspaceId}/insights/persons/{personId}/erase": {
429
+ parameters: {
430
+ query?: never;
431
+ header?: never;
432
+ path?: never;
433
+ cookie?: never;
434
+ };
435
+ get?: never;
436
+ put?: never;
437
+ /**
438
+ * Erase person-level insights data (workspace admin)
439
+ * @description Workspace admin only. Deletes or anonymizes a person's developer-insights rows for the workspace: org-chart node, person-scope dashboard metrics, AI-tool fact rows, HRIS absences, and readiness run requester linkage. Granular categories default to all enabled when the body is omitted. `personId` is the org-chart `person_id` (typically work email); URL-encode the path segment (e.g. `alice%40example.com`).
440
+ */
441
+ post: operations["eraseInsightsPerson"];
442
+ delete?: never;
443
+ options?: never;
444
+ head?: never;
445
+ patch?: never;
446
+ trace?: never;
447
+ };
428
448
  "/workspaces/{workspaceId}/insights/ai-usage-spend/aggregated-teams": {
429
449
  parameters: {
430
450
  query?: never;
@@ -2084,6 +2104,27 @@ export interface components {
2084
2104
  /** @enum {string} */
2085
2105
  role: "admin" | "editor" | "viewer";
2086
2106
  };
2107
+ /** @description Granular person erasure categories. All default to true when omitted. */
2108
+ EraseInsightsPersonBodyDto: {
2109
+ /** @description Remove the person node from `tai_workspace_config.org_chart`. */
2110
+ orgChart?: boolean;
2111
+ /** @description Delete person-scope rows in `tai_workspace_dashboard_metrics`. */
2112
+ dashboardMetrics?: boolean;
2113
+ /** @description Delete AI-tool seats and fact rows keyed to the person. */
2114
+ aiToolData?: boolean;
2115
+ /** @description Delete HRIS absence rows for the person's email. */
2116
+ absences?: boolean;
2117
+ /** @description Clear `requested_by_user_id` on readiness runs for matching app users. */
2118
+ readinessAnonymize?: boolean;
2119
+ };
2120
+ EraseInsightsPersonResultDto: {
2121
+ /** @enum {boolean} */
2122
+ deleted: true;
2123
+ aiToolRowsDeleted: number;
2124
+ absencesDeleted: number;
2125
+ readinessRunsAnonymized: number;
2126
+ auditEntriesAnonymized: number;
2127
+ };
2087
2128
  OrgChartNodeDto: {
2088
2129
  id: string;
2089
2130
  name: string;
@@ -2393,7 +2434,12 @@ export interface components {
2393
2434
  /** @description Short label for the week column (MM/DD), aligned with Measure charts. */
2394
2435
  weekLabel?: string;
2395
2436
  mergedPrCount: number;
2437
+ /** @description DORA change failure rate (deployments/incidents), not CI build failures. */
2396
2438
  failRatePercent: number;
2439
+ /** @description GitHub Actions / Checks CI build failure rate for the week bucket (failed runs / (failed + passed) * 100). Zero when GitHub Actions CI is disabled. */
2440
+ ciFailRatePercent?: number;
2441
+ /** @description Count of build.failed events in the week bucket when CI ingest is enabled. */
2442
+ ciBuildFailuresCount?: number;
2397
2443
  /** @description Mean hours from PR creation to first review in this week bucket. */
2398
2444
  avgReviewWaitHours?: number;
2399
2445
  /** @description Mean hours from first review to first approval in this week bucket. */
@@ -2426,6 +2472,8 @@ export interface components {
2426
2472
  scope: components["schemas"]["ProductivityInsightsAggregatedTeamsScopeDto"];
2427
2473
  /** Format: date-time */
2428
2474
  generatedAt: string;
2475
+ /** @description True when the workspace has opted in to GitHub Actions CI ingest. */
2476
+ githubActionsCiEnabled?: boolean;
2429
2477
  teams: components["schemas"]["ProductivityInsightsAggregatedTeamRowDto"][];
2430
2478
  };
2431
2479
  ProductivityInsightsMergedPrTrendWeekDto: {
@@ -2470,11 +2518,16 @@ export interface components {
2470
2518
  periodAvgMergedPrs: number;
2471
2519
  /** @description Average change failure rate over the range when available. */
2472
2520
  avgFailRatePercent?: number;
2521
+ /** @description Average GitHub Actions CI build failure rate over the range when CI ingest is enabled. */
2522
+ avgCiFailRatePercent?: number;
2473
2523
  };
2474
2524
  ProductivityInsightsTeamSummaryDto: {
2475
2525
  totalMergedPrs: number;
2476
2526
  avgMergedPrsPerWeek: number;
2527
+ /** @description Average DORA change failure rate over the range when available. */
2477
2528
  avgFailRatePercent: number;
2529
+ /** @description Average GitHub Actions CI build failure rate over the range when CI ingest is enabled. */
2530
+ avgCiFailRatePercent?: number;
2478
2531
  headcount: number;
2479
2532
  };
2480
2533
  ProductivityInsightsTeamDetailDto: {
@@ -2501,6 +2554,8 @@ export interface components {
2501
2554
  scope: components["schemas"]["ProductivityInsightsAggregatedTeamsScopeDto"];
2502
2555
  /** Format: date-time */
2503
2556
  generatedAt: string;
2557
+ /** @description True when the workspace has opted in to GitHub Actions CI ingest. */
2558
+ githubActionsCiEnabled?: boolean;
2504
2559
  /** @description Present when `teamId` query is omitted — top-ranked teams. */
2505
2560
  items?: components["schemas"]["ProductivityInsightsTeamLeaderItemDto"][];
2506
2561
  /** @description Present when `teamId` query is set — single-team drilldown. */
@@ -2528,6 +2583,8 @@ export interface components {
2528
2583
  absenceType?: string;
2529
2584
  failureSignal: boolean;
2530
2585
  failures: string[];
2586
+ /** @description Failed GitHub Actions workflow runs for this UTC day when CI ingest is enabled. */
2587
+ failureItems?: components["schemas"]["ProductivityInsightsContributorFailureItemDto"][];
2531
2588
  /** @description Optional PR rows with GitHub links when ingest stored URLs. */
2532
2589
  mergedPrItems?: components["schemas"]["ProductivityInsightsContributorMergedPrItemDto"][];
2533
2590
  };
@@ -2536,6 +2593,17 @@ export interface components {
2536
2593
  /** Format: uri */
2537
2594
  url?: string;
2538
2595
  };
2596
+ ProductivityInsightsContributorFailureItemDto: {
2597
+ label: string;
2598
+ /** Format: uri */
2599
+ url?: string;
2600
+ workflowName?: string;
2601
+ /** @description GitHub repository slug (owner/repo). */
2602
+ repo?: string;
2603
+ branch?: string;
2604
+ /** Format: date-time */
2605
+ occurredAt?: string;
2606
+ };
2539
2607
  ProductivityInsightsContributorActivityWeekDto: {
2540
2608
  label: string;
2541
2609
  /** Format: date-time */
@@ -2548,11 +2616,16 @@ export interface components {
2548
2616
  totalMergedPrs: number;
2549
2617
  avgMergedPrsPerWeek: number;
2550
2618
  totalAbsenceDays: number;
2619
+ /** @description CI failure rate (%) over the selected range when GitHub Actions CI ingest is enabled (failures / runs × 100); otherwise average DORA change failure rate when available. */
2551
2620
  avgFailRate: number;
2621
+ /** @description Average GitHub Actions CI build failure rate over the range when CI ingest is enabled. */
2622
+ avgCiFailRate?: number;
2552
2623
  mergedPrDelta: number;
2553
2624
  avgMergedPrsPerWeekDelta: number;
2554
2625
  totalAbsenceDaysDelta: number;
2555
2626
  avgFailRateDelta: number;
2627
+ /** @description Change in average CI build failure rate vs the prior comparison window. */
2628
+ avgCiFailRateDelta?: number;
2556
2629
  };
2557
2630
  ProductivityInsightsContributorDetailDto: {
2558
2631
  /** Format: uuid */
@@ -2564,6 +2637,8 @@ export interface components {
2564
2637
  scope: components["schemas"]["ProductivityInsightsAggregatedTeamsScopeDto"];
2565
2638
  /** Format: date-time */
2566
2639
  generatedAt: string;
2640
+ /** @description True when the workspace has opted in to GitHub Actions CI ingest. */
2641
+ githubActionsCiEnabled?: boolean;
2567
2642
  contributor: components["schemas"]["ProductivityInsightsContributorProfileDto"];
2568
2643
  weeks: components["schemas"]["ProductivityInsightsContributorActivityWeekDto"][];
2569
2644
  summary: components["schemas"]["ProductivityInsightsContributorActivitySummaryDto"];
@@ -2582,6 +2657,8 @@ export interface components {
2582
2657
  periodAvgMergedPrs: number;
2583
2658
  /** @description Mean weekly change-failure rate when available. */
2584
2659
  avgFailRatePercent?: number;
2660
+ /** @description Mean weekly GitHub Actions CI build failure rate when CI ingest is enabled. */
2661
+ avgCiFailRatePercent?: number;
2585
2662
  };
2586
2663
  ProductivityInsightsNeedsAttentionDto: {
2587
2664
  /** Format: uuid */
@@ -2592,6 +2669,8 @@ export interface components {
2592
2669
  entityType: "teams" | "contributors";
2593
2670
  /** Format: date-time */
2594
2671
  generatedAt: string;
2672
+ /** @description True when GitHub Actions CI ingest is enabled for this workspace. */
2673
+ githubActionsCiEnabled?: boolean;
2595
2674
  items: components["schemas"]["ProductivityInsightsNeedsAttentionItemDto"][];
2596
2675
  };
2597
2676
  AiUsageSpendAggregatedTeamWeekDto: {
@@ -4302,6 +4381,8 @@ export type TeamMemberDto = components['schemas']['TeamMemberDto'];
4302
4381
  export type TeamMemberListDto = components['schemas']['TeamMemberListDto'];
4303
4382
  export type InviteTeamMemberBodyDto = components['schemas']['InviteTeamMemberBodyDto'];
4304
4383
  export type UpdateTeamMemberRoleBodyDto = components['schemas']['UpdateTeamMemberRoleBodyDto'];
4384
+ export type EraseInsightsPersonBodyDto = components['schemas']['EraseInsightsPersonBodyDto'];
4385
+ export type EraseInsightsPersonResultDto = components['schemas']['EraseInsightsPersonResultDto'];
4305
4386
  export type OrgChartNodeDto = components['schemas']['OrgChartNodeDto'];
4306
4387
  export type OrgChartTreeNodeDto = components['schemas']['OrgChartTreeNodeDto'];
4307
4388
  export type ScoringOrgChartDto = components['schemas']['ScoringOrgChartDto'];
@@ -4344,6 +4425,7 @@ export type ProductivityInsightsTeamsResponseDto = components['schemas']['Produc
4344
4425
  export type ProductivityInsightsContributorProfileDto = components['schemas']['ProductivityInsightsContributorProfileDto'];
4345
4426
  export type ProductivityInsightsContributorActivityDayDto = components['schemas']['ProductivityInsightsContributorActivityDayDto'];
4346
4427
  export type ProductivityInsightsContributorMergedPrItemDto = components['schemas']['ProductivityInsightsContributorMergedPrItemDto'];
4428
+ export type ProductivityInsightsContributorFailureItemDto = components['schemas']['ProductivityInsightsContributorFailureItemDto'];
4347
4429
  export type ProductivityInsightsContributorActivityWeekDto = components['schemas']['ProductivityInsightsContributorActivityWeekDto'];
4348
4430
  export type ProductivityInsightsContributorActivitySummaryDto = components['schemas']['ProductivityInsightsContributorActivitySummaryDto'];
4349
4431
  export type ProductivityInsightsContributorDetailDto = components['schemas']['ProductivityInsightsContributorDetailDto'];
@@ -5647,6 +5729,63 @@ export interface operations {
5647
5729
  };
5648
5730
  };
5649
5731
  };
5732
+ eraseInsightsPerson: {
5733
+ parameters: {
5734
+ query?: never;
5735
+ header?: never;
5736
+ path: {
5737
+ workspaceId: components["parameters"]["WorkspaceId"];
5738
+ /** @description Org-chart person_id (URL-encoded when it contains `@`). */
5739
+ personId: string;
5740
+ };
5741
+ cookie?: never;
5742
+ };
5743
+ requestBody?: {
5744
+ content: {
5745
+ /**
5746
+ * @example {
5747
+ * "orgChart": true,
5748
+ * "dashboardMetrics": true,
5749
+ * "aiToolData": true,
5750
+ * "absences": true,
5751
+ * "readinessAnonymize": true
5752
+ * }
5753
+ */
5754
+ "application/json": components["schemas"]["EraseInsightsPersonBodyDto"];
5755
+ };
5756
+ };
5757
+ responses: {
5758
+ /** @description Person data erased or anonymized */
5759
+ 200: {
5760
+ headers: {
5761
+ [name: string]: unknown;
5762
+ };
5763
+ content: {
5764
+ "application/json": components["schemas"]["EraseInsightsPersonResultDto"];
5765
+ };
5766
+ };
5767
+ /** @description Invalid body or personId */
5768
+ 400: {
5769
+ headers: {
5770
+ [name: string]: unknown;
5771
+ };
5772
+ content: {
5773
+ "application/json": components["schemas"]["ErrorMessageDto"];
5774
+ };
5775
+ };
5776
+ 401: components["responses"]["Unauthorized"];
5777
+ 403: components["responses"]["Forbidden"];
5778
+ /** @description Workspace not found, malformed workspaceId, or person not in org chart */
5779
+ 404: {
5780
+ headers: {
5781
+ [name: string]: unknown;
5782
+ };
5783
+ content: {
5784
+ "application/json": components["schemas"]["ErrorMessageDto"];
5785
+ };
5786
+ };
5787
+ };
5788
+ };
5650
5789
  getAiUsageSpendAggregatedTeams: {
5651
5790
  parameters: {
5652
5791
  query?: {