@thinkai/tai-api-contract 2.213.0 → 2.215.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.
@@ -1026,6 +1026,50 @@ export interface paths {
1026
1026
  patch?: never;
1027
1027
  trace?: never;
1028
1028
  };
1029
+ "/workspaces/{workspaceId}/team-ownership": {
1030
+ parameters: {
1031
+ query?: never;
1032
+ header?: never;
1033
+ path?: never;
1034
+ cookie?: never;
1035
+ };
1036
+ /**
1037
+ * List team ownership mappings (Team Efficiency T1)
1038
+ * @description Returns org-chart team ownership of repos, services, and tracker teams, plus unmapped workspace repos and (when Datadog is connected) unmapped catalog services. Requires `backend-api.teamEfficiency.enabled` (or workspace allowlist); otherwise `404` with `code: team_efficiency_disabled`. Member read.
1039
+ */
1040
+ get: operations["getWorkspaceTeamOwnership"];
1041
+ /**
1042
+ * Replace team ownership mappings (Team Efficiency T1)
1043
+ * @description Full-replace ownership rows. Requires workspace **admin**. Flag-gated like GET (`404` `team_efficiency_disabled` when off).
1044
+ */
1045
+ put: operations["putWorkspaceTeamOwnership"];
1046
+ post?: never;
1047
+ delete?: never;
1048
+ options?: never;
1049
+ head?: never;
1050
+ patch?: never;
1051
+ trace?: never;
1052
+ };
1053
+ "/workspaces/{workspaceId}/team-ownership/import-datadog-catalog": {
1054
+ parameters: {
1055
+ query?: never;
1056
+ header?: never;
1057
+ path?: never;
1058
+ cookie?: never;
1059
+ };
1060
+ get?: never;
1061
+ put?: never;
1062
+ /**
1063
+ * Import Datadog service-catalog team ownership
1064
+ * @description Reads Datadog service definitions (`team` / `dd-team`), matches labels to org-chart team id or name (case-insensitive), and upserts `kind=service` rows with `provider=datadog`. Admin only; flag-gated.
1065
+ */
1066
+ post: operations["importDatadogTeamOwnershipCatalog"];
1067
+ delete?: never;
1068
+ options?: never;
1069
+ head?: never;
1070
+ patch?: never;
1071
+ trace?: never;
1072
+ };
1029
1073
  "/workspaces/{workspaceId}/productivity-targets": {
1030
1074
  parameters: {
1031
1075
  query?: never;
@@ -6922,6 +6966,58 @@ export interface components {
6922
6966
  /** @enum {string|null} */
6923
6967
  idpType?: "okta" | "entra" | "saml" | null;
6924
6968
  };
6969
+ /** @enum {string} */
6970
+ TeamOwnershipKindDto: "repo" | "service" | "tracker_team";
6971
+ TeamOwnershipMappingDto: {
6972
+ /** Format: uuid */
6973
+ id: string;
6974
+ /** @description Org-chart team node id */
6975
+ teamId: string;
6976
+ kind: components["schemas"]["TeamOwnershipKindDto"];
6977
+ /** @description e.g. github, datadog, linear */
6978
+ provider: string;
6979
+ /** @description Repo slug, service name, or tracker team key */
6980
+ key: string;
6981
+ /** Format: date-time */
6982
+ createdAt: string;
6983
+ /** Format: date-time */
6984
+ updatedAt: string;
6985
+ };
6986
+ TeamOwnershipUnmappedDto: {
6987
+ /** @description Workspace repo provider_slugs with no kind=repo mapping */
6988
+ repos: string[];
6989
+ /** @description Datadog catalog services with no kind=service mapping (empty when Datadog disconnected) */
6990
+ services: string[];
6991
+ };
6992
+ TeamOwnershipListDto: {
6993
+ mappings: components["schemas"]["TeamOwnershipMappingDto"][];
6994
+ unmapped: components["schemas"]["TeamOwnershipUnmappedDto"];
6995
+ };
6996
+ TeamOwnershipMappingInputDto: {
6997
+ teamId: string;
6998
+ kind: components["schemas"]["TeamOwnershipKindDto"];
6999
+ provider: string;
7000
+ key: string;
7001
+ };
7002
+ TeamOwnershipReplaceDto: {
7003
+ mappings: components["schemas"]["TeamOwnershipMappingInputDto"][];
7004
+ };
7005
+ TeamOwnershipDatadogImportMatchDto: {
7006
+ teamId: string;
7007
+ service: string;
7008
+ catalogTeam: string;
7009
+ };
7010
+ TeamOwnershipDatadogImportUnmatchedDto: {
7011
+ service: string;
7012
+ catalogTeam: string | null;
7013
+ };
7014
+ TeamOwnershipDatadogImportResultDto: {
7015
+ importedCount: number;
7016
+ upserted: number;
7017
+ unmatchedCount: number;
7018
+ imported: components["schemas"]["TeamOwnershipDatadogImportMatchDto"][];
7019
+ unmatched: components["schemas"]["TeamOwnershipDatadogImportUnmatchedDto"][];
7020
+ };
6925
7021
  /** @description Optional weekly per-engineer targets for Productivity Insights. Omitted or null fields mean no target for that metric. Additional properties are rejected. */
6926
7022
  ProductivityTargetsDto: {
6927
7023
  /** @description Floor — meet or exceed this many merged PRs per engineer per week. */
@@ -11257,6 +11353,8 @@ export interface components {
11257
11353
  skippedRepoCount?: number;
11258
11354
  failedRepoCount?: number;
11259
11355
  coveragePercent?: number | null;
11356
+ /** @description Full repository count before the `repos` array is capped (500). When greater than `repos.length`, the list is truncated for the response. */
11357
+ totalRepoCount?: number;
11260
11358
  repos?: components["schemas"]["IngestCoverageProductivityRepoDto"][];
11261
11359
  /** @description Latest depth-scan and week-reconcile summary from stored activity rows. Null when neither event exists. The coverage GET does not run a scan. */
11262
11360
  selfHeal?: components["schemas"]["IngestCoverageProductivitySelfHealDto"] | null;
@@ -11406,7 +11504,7 @@ export interface components {
11406
11504
  targetWindowDays: number;
11407
11505
  ingestedFrom?: string | null;
11408
11506
  ingestedTo?: string | null;
11409
- /** @description Productivity: stored merged pull requests divided by merged pull requests GitHub has in the 180-day window. Sums the latest numeric check of each repository. A check with 0 stored and 0 on GitHub counts as covered and does not change the ratio. 100 when every checked repository is in that state. Null when no repository has a numeric check. Other pipeline kinds keep their own progress meaning. */
11507
+ /** @description Productivity: stored merged pull requests divided by merged pull requests GitHub has in the 180-day window. Sums the latest numeric check of each repository. A check with 0 stored and 0 on GitHub counts as covered and does not change the ratio. 100 when every checked repository is in that state. Null when no repository has a numeric check. AI usage: lookback window fill (days present / expected days), including after backfill closes; while Cursor spend backfill is open may use the spend cursor instead. Null when no expected window exists yet. Other pipeline kinds keep their own progress meaning. */
11410
11508
  progressPercent?: number | null;
11411
11509
  /** Format: date-time */
11412
11510
  lastSuccessAt?: string | null;
@@ -13876,6 +13974,15 @@ export type AdminEnterpriseSsoApplyRequestDto = components['schemas']['AdminEnte
13876
13974
  export type AdminEnterpriseSsoApplyResponseDto = components['schemas']['AdminEnterpriseSsoApplyResponseDto'];
13877
13975
  export type AdminEnterpriseSsoRejectRequestDto = components['schemas']['AdminEnterpriseSsoRejectRequestDto'];
13878
13976
  export type AuthSsoLookupDto = components['schemas']['AuthSsoLookupDto'];
13977
+ export type TeamOwnershipKindDto = components['schemas']['TeamOwnershipKindDto'];
13978
+ export type TeamOwnershipMappingDto = components['schemas']['TeamOwnershipMappingDto'];
13979
+ export type TeamOwnershipUnmappedDto = components['schemas']['TeamOwnershipUnmappedDto'];
13980
+ export type TeamOwnershipListDto = components['schemas']['TeamOwnershipListDto'];
13981
+ export type TeamOwnershipMappingInputDto = components['schemas']['TeamOwnershipMappingInputDto'];
13982
+ export type TeamOwnershipReplaceDto = components['schemas']['TeamOwnershipReplaceDto'];
13983
+ export type TeamOwnershipDatadogImportMatchDto = components['schemas']['TeamOwnershipDatadogImportMatchDto'];
13984
+ export type TeamOwnershipDatadogImportUnmatchedDto = components['schemas']['TeamOwnershipDatadogImportUnmatchedDto'];
13985
+ export type TeamOwnershipDatadogImportResultDto = components['schemas']['TeamOwnershipDatadogImportResultDto'];
13879
13986
  export type ProductivityTargetsDto = components['schemas']['ProductivityTargetsDto'];
13880
13987
  export type DimensionTargetPercentsDto = components['schemas']['DimensionTargetPercentsDto'];
13881
13988
  export type DimensionTargetsRepoOverrideDto = components['schemas']['DimensionTargetsRepoOverrideDto'];
@@ -17613,6 +17720,144 @@ export interface operations {
17613
17720
  };
17614
17721
  };
17615
17722
  };
17723
+ getWorkspaceTeamOwnership: {
17724
+ parameters: {
17725
+ query?: never;
17726
+ header?: never;
17727
+ path: {
17728
+ workspaceId: components["parameters"]["WorkspaceId"];
17729
+ };
17730
+ cookie?: never;
17731
+ };
17732
+ requestBody?: never;
17733
+ responses: {
17734
+ /** @description Current mappings and unmapped inventory */
17735
+ 200: {
17736
+ headers: {
17737
+ [name: string]: unknown;
17738
+ };
17739
+ content: {
17740
+ "application/json": components["schemas"]["TeamOwnershipListDto"];
17741
+ };
17742
+ };
17743
+ 401: components["responses"]["Unauthorized"];
17744
+ 403: components["responses"]["Forbidden"];
17745
+ /** @description Workspace missing or Team Efficiency disabled */
17746
+ 404: {
17747
+ headers: {
17748
+ [name: string]: unknown;
17749
+ };
17750
+ content: {
17751
+ "application/json": components["schemas"]["ErrorMessageDto"];
17752
+ };
17753
+ };
17754
+ };
17755
+ };
17756
+ putWorkspaceTeamOwnership: {
17757
+ parameters: {
17758
+ query?: never;
17759
+ header?: never;
17760
+ path: {
17761
+ workspaceId: components["parameters"]["WorkspaceId"];
17762
+ };
17763
+ cookie?: never;
17764
+ };
17765
+ requestBody: {
17766
+ content: {
17767
+ "application/json": components["schemas"]["TeamOwnershipReplaceDto"];
17768
+ };
17769
+ };
17770
+ responses: {
17771
+ /** @description Replaced mappings */
17772
+ 200: {
17773
+ headers: {
17774
+ [name: string]: unknown;
17775
+ };
17776
+ content: {
17777
+ "application/json": components["schemas"]["TeamOwnershipListDto"];
17778
+ };
17779
+ };
17780
+ /** @description Invalid payload */
17781
+ 400: {
17782
+ headers: {
17783
+ [name: string]: unknown;
17784
+ };
17785
+ content: {
17786
+ "application/json": components["schemas"]["ErrorMessageDto"];
17787
+ };
17788
+ };
17789
+ 401: components["responses"]["Unauthorized"];
17790
+ /** @description Forbidden — workspace admin required */
17791
+ 403: {
17792
+ headers: {
17793
+ [name: string]: unknown;
17794
+ };
17795
+ content: {
17796
+ "application/json": components["schemas"]["ErrorMessageDto"];
17797
+ };
17798
+ };
17799
+ /** @description Workspace missing or Team Efficiency disabled */
17800
+ 404: {
17801
+ headers: {
17802
+ [name: string]: unknown;
17803
+ };
17804
+ content: {
17805
+ "application/json": components["schemas"]["ErrorMessageDto"];
17806
+ };
17807
+ };
17808
+ };
17809
+ };
17810
+ importDatadogTeamOwnershipCatalog: {
17811
+ parameters: {
17812
+ query?: never;
17813
+ header?: never;
17814
+ path: {
17815
+ workspaceId: components["parameters"]["WorkspaceId"];
17816
+ };
17817
+ cookie?: never;
17818
+ };
17819
+ requestBody?: never;
17820
+ responses: {
17821
+ /** @description Import result */
17822
+ 200: {
17823
+ headers: {
17824
+ [name: string]: unknown;
17825
+ };
17826
+ content: {
17827
+ "application/json": components["schemas"]["TeamOwnershipDatadogImportResultDto"];
17828
+ };
17829
+ };
17830
+ 401: components["responses"]["Unauthorized"];
17831
+ 403: components["responses"]["Forbidden"];
17832
+ /** @description Workspace missing or Team Efficiency disabled */
17833
+ 404: {
17834
+ headers: {
17835
+ [name: string]: unknown;
17836
+ };
17837
+ content: {
17838
+ "application/json": components["schemas"]["ErrorMessageDto"];
17839
+ };
17840
+ };
17841
+ /** @description Datadog not connected */
17842
+ 422: {
17843
+ headers: {
17844
+ [name: string]: unknown;
17845
+ };
17846
+ content: {
17847
+ "application/json": components["schemas"]["ErrorMessageDto"];
17848
+ };
17849
+ };
17850
+ /** @description Datadog catalog fetch failed */
17851
+ 503: {
17852
+ headers: {
17853
+ [name: string]: unknown;
17854
+ };
17855
+ content: {
17856
+ "application/json": components["schemas"]["ErrorMessageDto"];
17857
+ };
17858
+ };
17859
+ };
17860
+ };
17616
17861
  getWorkspaceProductivityTargets: {
17617
17862
  parameters: {
17618
17863
  query?: never;
package/src/index.ts CHANGED
@@ -1514,6 +1514,11 @@ export interface IngestCoverageProductivityDetailDto {
1514
1514
  skippedRepoCount?: number;
1515
1515
  failedRepoCount?: number;
1516
1516
  coveragePercent?: number | null;
1517
+ /**
1518
+ * Full repository count for this productivity pipeline before the `repos` array cap.
1519
+ * When greater than `repos.length`, the list is truncated for the response.
1520
+ */
1521
+ totalRepoCount?: number;
1517
1522
  repos?: IngestCoverageProductivityRepoDto[];
1518
1523
  /**
1519
1524
  * Null when the pipeline exists but no depth-scan completed event and no week-reconcile