@thinkai/tai-api-contract 2.216.0 → 2.219.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.
@@ -1637,6 +1637,26 @@ export interface paths {
1637
1637
  patch?: never;
1638
1638
  trace?: never;
1639
1639
  };
1640
+ "/workspaces/{workspaceId}/insights/team-efficiency/bundle": {
1641
+ parameters: {
1642
+ query?: never;
1643
+ header?: never;
1644
+ path?: never;
1645
+ cookie?: never;
1646
+ };
1647
+ /**
1648
+ * Team Efficiency page bundle
1649
+ * @description One round trip for the Team Efficiency page. Metrics are computed for the rolling `months` calendar months (default 3) against the previous period. A department is the union of its teams. All departments plus all teams, and person scope, are rejected with 400. Returns 404 when `backend-api.teamEfficiency` is off (unless the workspace is on the allowlist).
1650
+ */
1651
+ get: operations["getTeamEfficiencyBundle"];
1652
+ put?: never;
1653
+ post?: never;
1654
+ delete?: never;
1655
+ options?: never;
1656
+ head?: never;
1657
+ patch?: never;
1658
+ trace?: never;
1659
+ };
1640
1660
  "/workspaces/{workspaceId}/insights/devex/sync": {
1641
1661
  parameters: {
1642
1662
  query?: never;
@@ -6650,6 +6670,133 @@ export interface components {
6650
6670
  metricId: "devex-score";
6651
6671
  results: components["schemas"]["DevexResultDto"][];
6652
6672
  };
6673
+ TeamEfficiencyDataQualityDto: {
6674
+ /** @enum {string} */
6675
+ code: "low_data" | "missing_start" | "batch_closed" | "no_roster" | "not_configured" | "no_bug_data" | "no_survey" | "unattributed_failures" | "excluded_incidents" | "unlinked_incidents" | "unknown_review_comments" | "no_linked_deploys" | "no_deployments" | "six_month_window";
6676
+ message: string;
6677
+ percent?: number;
6678
+ count?: number;
6679
+ };
6680
+ TeamEfficiencyMetricDto: {
6681
+ /** @enum {string} */
6682
+ id: "flow-time" | "pr-throughput-per-engineer" | "escaped-defects" | "devex-score" | "deployment-frequency" | "lead-time-for-changes" | "change-failure-rate" | "time-to-restore" | "pr-size" | "time-to-first-review" | "pr-approvals-without-comments";
6683
+ label: string;
6684
+ /** @description Short card label, for example "Recovery time". */
6685
+ shortLabel?: string;
6686
+ unit: string;
6687
+ value?: number;
6688
+ p85?: number;
6689
+ previous?: number;
6690
+ /** @description Per calendar month in the window, oldest first. null when no data. */
6691
+ monthly: (number | null)[];
6692
+ sampleSize: number;
6693
+ /** @description Fewer than 10 samples. */
6694
+ lowData: boolean;
6695
+ reportable: boolean;
6696
+ numerator?: number;
6697
+ denominator?: number;
6698
+ owner: string;
6699
+ counterweightIds: string[];
6700
+ dataQuality: components["schemas"]["TeamEfficiencyDataQualityDto"][];
6701
+ /** @description Drill-through route; the client appends scope and window. */
6702
+ href: string;
6703
+ /** @description Counts by key, for example escaped defects by severity. */
6704
+ breakdown?: {
6705
+ [key: string]: number;
6706
+ };
6707
+ /** @description The same series for the months before `monthly`, oldest first. */
6708
+ previousMonthly?: (number | null)[];
6709
+ stages?: components["schemas"]["TeamEfficiencyLeadTimeStagesDto"];
6710
+ devex?: components["schemas"]["TeamEfficiencyDevexDetailDto"];
6711
+ signals?: components["schemas"]["TeamEfficiencySignalDto"][];
6712
+ };
6713
+ /** @description Median hours per lead-time stage. */
6714
+ TeamEfficiencyLeadTimeStagesDto: {
6715
+ codingHours: number;
6716
+ pickupHours: number;
6717
+ reviewHours: number;
6718
+ deployHours: number;
6719
+ };
6720
+ TeamEfficiencySignalDto: {
6721
+ /** @enum {string} */
6722
+ id: "review-time-drop" | "approvals-without-comments-rise" | "pr-size-falling-flow-flat";
6723
+ label: string;
6724
+ flagged: boolean;
6725
+ /** @description Short detail shown when flagged, for example "24% to 31%". */
6726
+ detail?: string;
6727
+ };
6728
+ TeamEfficiencyDevexDetailDto: {
6729
+ /** @example 2026-Q3 */
6730
+ quarter: string;
6731
+ dimensions: {
6732
+ feedbackLoops: number;
6733
+ cognitiveLoad: number;
6734
+ flowState: number;
6735
+ };
6736
+ /** @description Latest quarters, oldest first. */
6737
+ quarters: {
6738
+ quarter: string;
6739
+ score: number;
6740
+ }[];
6741
+ responseCount: number;
6742
+ rosterSize?: number;
6743
+ /** @description 0 to 1. */
6744
+ responseRate?: number;
6745
+ lowResponseRate: boolean;
6746
+ /** @description Fewer than 5 responses, so the score shown is the department's. */
6747
+ rolledUp: boolean;
6748
+ };
6749
+ TeamEfficiencySetupItemDto: {
6750
+ id: string;
6751
+ label: string;
6752
+ done: boolean;
6753
+ hint: string;
6754
+ };
6755
+ TeamEfficiencyBundleDto: {
6756
+ summary: {
6757
+ engineers: number;
6758
+ issuesDone: number;
6759
+ mergedPrs: number;
6760
+ deployments: number;
6761
+ survey?: {
6762
+ responses: number;
6763
+ invited?: number;
6764
+ };
6765
+ };
6766
+ /** @description Share of engineers using an AI tool per month, for the months before the window followed by the window months, oldest first. null when no data. */
6767
+ aiAdoption: (number | null)[];
6768
+ scope: {
6769
+ department?: string;
6770
+ team?: string;
6771
+ teamIds: string[];
6772
+ /** @description Org-chart engineers, excluding managers, product managers and designers. */
6773
+ rosterEngineerCount: number;
6774
+ };
6775
+ window: {
6776
+ monthCount: number;
6777
+ /** Format: date-time */
6778
+ start: string;
6779
+ /** Format: date-time */
6780
+ end: string;
6781
+ /** Format: date-time */
6782
+ previousStart: string;
6783
+ /** Format: date-time */
6784
+ previousEnd: string;
6785
+ months: {
6786
+ /** Format: date-time */
6787
+ start: string;
6788
+ /** Format: date-time */
6789
+ end: string;
6790
+ }[];
6791
+ };
6792
+ metrics: components["schemas"]["TeamEfficiencyMetricDto"][];
6793
+ setup: {
6794
+ items: components["schemas"]["TeamEfficiencySetupItemDto"][];
6795
+ complete: boolean;
6796
+ };
6797
+ /** Format: date-time */
6798
+ generatedAt: string;
6799
+ };
6653
6800
  DevexSyncRequestDto: {
6654
6801
  /** @example 2026-Q1 */
6655
6802
  quarter?: string;
@@ -7261,6 +7408,26 @@ export interface components {
7261
7408
  clusterName?: string;
7262
7409
  /** @description Present for Prometheus verify success — Alertmanager version when available. */
7263
7410
  version?: string;
7411
+ /** @description Present for SurveyMonkey verify success. Question and choice labels only (never answers), so the connect screen can pick the team question and rating questions. */
7412
+ survey?: {
7413
+ title: string;
7414
+ questions: {
7415
+ id: string;
7416
+ text: string;
7417
+ /** @description Every choice carries a 1-5 weight or position, so the question can be scored. */
7418
+ ratingScale: boolean;
7419
+ choices: {
7420
+ id: string;
7421
+ text: string;
7422
+ }[];
7423
+ }[];
7424
+ };
7425
+ /** @description Present for SurveyMonkey verify success when the request carried `teamQuestionId`. How many survey choices matched an org-chart team by name. */
7426
+ teamMatch?: {
7427
+ matched: number;
7428
+ total: number;
7429
+ unmatched: string[];
7430
+ };
7264
7431
  };
7265
7432
  CursorKeyUsageDto: {
7266
7433
  /** @description Readiness runs this calendar month that used the ThinkAI platform Cursor key. */
@@ -14102,6 +14269,13 @@ export type SurveyMonkeySourceDto = components['schemas']['SurveyMonkeySourceDto
14102
14269
  export type SurveyMonkeySourceConfigDto = components['schemas']['SurveyMonkeySourceConfigDto'];
14103
14270
  export type DevexResultDto = components['schemas']['DevexResultDto'];
14104
14271
  export type DevexResultsResponseDto = components['schemas']['DevexResultsResponseDto'];
14272
+ export type TeamEfficiencyDataQualityDto = components['schemas']['TeamEfficiencyDataQualityDto'];
14273
+ export type TeamEfficiencyMetricDto = components['schemas']['TeamEfficiencyMetricDto'];
14274
+ export type TeamEfficiencyLeadTimeStagesDto = components['schemas']['TeamEfficiencyLeadTimeStagesDto'];
14275
+ export type TeamEfficiencySignalDto = components['schemas']['TeamEfficiencySignalDto'];
14276
+ export type TeamEfficiencyDevexDetailDto = components['schemas']['TeamEfficiencyDevexDetailDto'];
14277
+ export type TeamEfficiencySetupItemDto = components['schemas']['TeamEfficiencySetupItemDto'];
14278
+ export type TeamEfficiencyBundleDto = components['schemas']['TeamEfficiencyBundleDto'];
14105
14279
  export type DevexSyncRequestDto = components['schemas']['DevexSyncRequestDto'];
14106
14280
  export type DevexSyncResultDto = components['schemas']['DevexSyncResultDto'];
14107
14281
  export type IncidentIoSourceDto = components['schemas']['IncidentIoSourceDto'];
@@ -19644,6 +19818,53 @@ export interface operations {
19644
19818
  };
19645
19819
  };
19646
19820
  };
19821
+ getTeamEfficiencyBundle: {
19822
+ parameters: {
19823
+ query?: {
19824
+ department?: string;
19825
+ team?: string;
19826
+ months?: number;
19827
+ };
19828
+ header?: never;
19829
+ path: {
19830
+ workspaceId: components["parameters"]["WorkspaceId"];
19831
+ };
19832
+ cookie?: never;
19833
+ };
19834
+ requestBody?: never;
19835
+ responses: {
19836
+ /** @description Team Efficiency metrics, window, and setup checklist */
19837
+ 200: {
19838
+ headers: {
19839
+ [name: string]: unknown;
19840
+ };
19841
+ content: {
19842
+ "application/json": components["schemas"]["TeamEfficiencyBundleDto"];
19843
+ };
19844
+ };
19845
+ /** @description Invalid scope or months (`scope_required`, `person_scope_not_supported`, `team_not_found`, `department_not_found`, `invalid_months`) */
19846
+ 400: {
19847
+ headers: {
19848
+ [name: string]: unknown;
19849
+ };
19850
+ content: {
19851
+ "application/json": {
19852
+ error: string;
19853
+ code: string;
19854
+ };
19855
+ };
19856
+ };
19857
+ 401: components["responses"]["Unauthorized"];
19858
+ 403: components["responses"]["Forbidden"];
19859
+ /** @description Feature flag off or workspace not found */
19860
+ 404: {
19861
+ headers: {
19862
+ [name: string]: unknown;
19863
+ };
19864
+ content?: never;
19865
+ };
19866
+ };
19867
+ };
19647
19868
  syncDevexSurvey: {
19648
19869
  parameters: {
19649
19870
  query?: never;