@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.
@@ -1025,6 +1025,50 @@ export interface paths {
1025
1025
  patch?: never;
1026
1026
  trace?: never;
1027
1027
  };
1028
+ "/workspaces/{workspaceId}/team-ownership": {
1029
+ parameters: {
1030
+ query?: never;
1031
+ header?: never;
1032
+ path?: never;
1033
+ cookie?: never;
1034
+ };
1035
+ /**
1036
+ * List team ownership mappings (Team Efficiency T1)
1037
+ * @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.
1038
+ */
1039
+ get: operations["getWorkspaceTeamOwnership"];
1040
+ /**
1041
+ * Replace team ownership mappings (Team Efficiency T1)
1042
+ * @description Full-replace ownership rows. Requires workspace **admin**. Flag-gated like GET (`404` `team_efficiency_disabled` when off).
1043
+ */
1044
+ put: operations["putWorkspaceTeamOwnership"];
1045
+ post?: never;
1046
+ delete?: never;
1047
+ options?: never;
1048
+ head?: never;
1049
+ patch?: never;
1050
+ trace?: never;
1051
+ };
1052
+ "/workspaces/{workspaceId}/team-ownership/import-datadog-catalog": {
1053
+ parameters: {
1054
+ query?: never;
1055
+ header?: never;
1056
+ path?: never;
1057
+ cookie?: never;
1058
+ };
1059
+ get?: never;
1060
+ put?: never;
1061
+ /**
1062
+ * Import Datadog service-catalog team ownership
1063
+ * @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.
1064
+ */
1065
+ post: operations["importDatadogTeamOwnershipCatalog"];
1066
+ delete?: never;
1067
+ options?: never;
1068
+ head?: never;
1069
+ patch?: never;
1070
+ trace?: never;
1071
+ };
1028
1072
  "/workspaces/{workspaceId}/productivity-targets": {
1029
1073
  parameters: {
1030
1074
  query?: never;
@@ -6921,6 +6965,58 @@ export interface components {
6921
6965
  /** @enum {string|null} */
6922
6966
  idpType?: "okta" | "entra" | "saml" | null;
6923
6967
  };
6968
+ /** @enum {string} */
6969
+ TeamOwnershipKindDto: "repo" | "service" | "tracker_team";
6970
+ TeamOwnershipMappingDto: {
6971
+ /** Format: uuid */
6972
+ id: string;
6973
+ /** @description Org-chart team node id */
6974
+ teamId: string;
6975
+ kind: components["schemas"]["TeamOwnershipKindDto"];
6976
+ /** @description e.g. github, datadog, linear */
6977
+ provider: string;
6978
+ /** @description Repo slug, service name, or tracker team key */
6979
+ key: string;
6980
+ /** Format: date-time */
6981
+ createdAt: string;
6982
+ /** Format: date-time */
6983
+ updatedAt: string;
6984
+ };
6985
+ TeamOwnershipUnmappedDto: {
6986
+ /** @description Workspace repo provider_slugs with no kind=repo mapping */
6987
+ repos: string[];
6988
+ /** @description Datadog catalog services with no kind=service mapping (empty when Datadog disconnected) */
6989
+ services: string[];
6990
+ };
6991
+ TeamOwnershipListDto: {
6992
+ mappings: components["schemas"]["TeamOwnershipMappingDto"][];
6993
+ unmapped: components["schemas"]["TeamOwnershipUnmappedDto"];
6994
+ };
6995
+ TeamOwnershipMappingInputDto: {
6996
+ teamId: string;
6997
+ kind: components["schemas"]["TeamOwnershipKindDto"];
6998
+ provider: string;
6999
+ key: string;
7000
+ };
7001
+ TeamOwnershipReplaceDto: {
7002
+ mappings: components["schemas"]["TeamOwnershipMappingInputDto"][];
7003
+ };
7004
+ TeamOwnershipDatadogImportMatchDto: {
7005
+ teamId: string;
7006
+ service: string;
7007
+ catalogTeam: string;
7008
+ };
7009
+ TeamOwnershipDatadogImportUnmatchedDto: {
7010
+ service: string;
7011
+ catalogTeam: string | null;
7012
+ };
7013
+ TeamOwnershipDatadogImportResultDto: {
7014
+ importedCount: number;
7015
+ upserted: number;
7016
+ unmatchedCount: number;
7017
+ imported: components["schemas"]["TeamOwnershipDatadogImportMatchDto"][];
7018
+ unmatched: components["schemas"]["TeamOwnershipDatadogImportUnmatchedDto"][];
7019
+ };
6924
7020
  /** @description Optional weekly per-engineer targets for Productivity Insights. Omitted or null fields mean no target for that metric. Additional properties are rejected. */
6925
7021
  ProductivityTargetsDto: {
6926
7022
  /** @description Floor — meet or exceed this many merged PRs per engineer per week. */
@@ -11256,6 +11352,8 @@ export interface components {
11256
11352
  skippedRepoCount?: number;
11257
11353
  failedRepoCount?: number;
11258
11354
  coveragePercent?: number | null;
11355
+ /** @description Full repository count before the `repos` array is capped (500). When greater than `repos.length`, the list is truncated for the response. */
11356
+ totalRepoCount?: number;
11259
11357
  repos?: components["schemas"]["IngestCoverageProductivityRepoDto"][];
11260
11358
  /** @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. */
11261
11359
  selfHeal?: components["schemas"]["IngestCoverageProductivitySelfHealDto"] | null;
@@ -11405,7 +11503,7 @@ export interface components {
11405
11503
  targetWindowDays: number;
11406
11504
  ingestedFrom?: string | null;
11407
11505
  ingestedTo?: string | null;
11408
- /** @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. */
11506
+ /** @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. */
11409
11507
  progressPercent?: number | null;
11410
11508
  /** Format: date-time */
11411
11509
  lastSuccessAt?: string | null;
@@ -13875,6 +13973,15 @@ export type AdminEnterpriseSsoApplyRequestDto = components['schemas']['AdminEnte
13875
13973
  export type AdminEnterpriseSsoApplyResponseDto = components['schemas']['AdminEnterpriseSsoApplyResponseDto'];
13876
13974
  export type AdminEnterpriseSsoRejectRequestDto = components['schemas']['AdminEnterpriseSsoRejectRequestDto'];
13877
13975
  export type AuthSsoLookupDto = components['schemas']['AuthSsoLookupDto'];
13976
+ export type TeamOwnershipKindDto = components['schemas']['TeamOwnershipKindDto'];
13977
+ export type TeamOwnershipMappingDto = components['schemas']['TeamOwnershipMappingDto'];
13978
+ export type TeamOwnershipUnmappedDto = components['schemas']['TeamOwnershipUnmappedDto'];
13979
+ export type TeamOwnershipListDto = components['schemas']['TeamOwnershipListDto'];
13980
+ export type TeamOwnershipMappingInputDto = components['schemas']['TeamOwnershipMappingInputDto'];
13981
+ export type TeamOwnershipReplaceDto = components['schemas']['TeamOwnershipReplaceDto'];
13982
+ export type TeamOwnershipDatadogImportMatchDto = components['schemas']['TeamOwnershipDatadogImportMatchDto'];
13983
+ export type TeamOwnershipDatadogImportUnmatchedDto = components['schemas']['TeamOwnershipDatadogImportUnmatchedDto'];
13984
+ export type TeamOwnershipDatadogImportResultDto = components['schemas']['TeamOwnershipDatadogImportResultDto'];
13878
13985
  export type ProductivityTargetsDto = components['schemas']['ProductivityTargetsDto'];
13879
13986
  export type DimensionTargetPercentsDto = components['schemas']['DimensionTargetPercentsDto'];
13880
13987
  export type DimensionTargetsRepoOverrideDto = components['schemas']['DimensionTargetsRepoOverrideDto'];
@@ -17612,6 +17719,144 @@ export interface operations {
17612
17719
  };
17613
17720
  };
17614
17721
  };
17722
+ getWorkspaceTeamOwnership: {
17723
+ parameters: {
17724
+ query?: never;
17725
+ header?: never;
17726
+ path: {
17727
+ workspaceId: components["parameters"]["WorkspaceId"];
17728
+ };
17729
+ cookie?: never;
17730
+ };
17731
+ requestBody?: never;
17732
+ responses: {
17733
+ /** @description Current mappings and unmapped inventory */
17734
+ 200: {
17735
+ headers: {
17736
+ [name: string]: unknown;
17737
+ };
17738
+ content: {
17739
+ "application/json": components["schemas"]["TeamOwnershipListDto"];
17740
+ };
17741
+ };
17742
+ 401: components["responses"]["Unauthorized"];
17743
+ 403: components["responses"]["Forbidden"];
17744
+ /** @description Workspace missing or Team Efficiency disabled */
17745
+ 404: {
17746
+ headers: {
17747
+ [name: string]: unknown;
17748
+ };
17749
+ content: {
17750
+ "application/json": components["schemas"]["ErrorMessageDto"];
17751
+ };
17752
+ };
17753
+ };
17754
+ };
17755
+ putWorkspaceTeamOwnership: {
17756
+ parameters: {
17757
+ query?: never;
17758
+ header?: never;
17759
+ path: {
17760
+ workspaceId: components["parameters"]["WorkspaceId"];
17761
+ };
17762
+ cookie?: never;
17763
+ };
17764
+ requestBody: {
17765
+ content: {
17766
+ "application/json": components["schemas"]["TeamOwnershipReplaceDto"];
17767
+ };
17768
+ };
17769
+ responses: {
17770
+ /** @description Replaced mappings */
17771
+ 200: {
17772
+ headers: {
17773
+ [name: string]: unknown;
17774
+ };
17775
+ content: {
17776
+ "application/json": components["schemas"]["TeamOwnershipListDto"];
17777
+ };
17778
+ };
17779
+ /** @description Invalid payload */
17780
+ 400: {
17781
+ headers: {
17782
+ [name: string]: unknown;
17783
+ };
17784
+ content: {
17785
+ "application/json": components["schemas"]["ErrorMessageDto"];
17786
+ };
17787
+ };
17788
+ 401: components["responses"]["Unauthorized"];
17789
+ /** @description Forbidden — workspace admin required */
17790
+ 403: {
17791
+ headers: {
17792
+ [name: string]: unknown;
17793
+ };
17794
+ content: {
17795
+ "application/json": components["schemas"]["ErrorMessageDto"];
17796
+ };
17797
+ };
17798
+ /** @description Workspace missing or Team Efficiency disabled */
17799
+ 404: {
17800
+ headers: {
17801
+ [name: string]: unknown;
17802
+ };
17803
+ content: {
17804
+ "application/json": components["schemas"]["ErrorMessageDto"];
17805
+ };
17806
+ };
17807
+ };
17808
+ };
17809
+ importDatadogTeamOwnershipCatalog: {
17810
+ parameters: {
17811
+ query?: never;
17812
+ header?: never;
17813
+ path: {
17814
+ workspaceId: components["parameters"]["WorkspaceId"];
17815
+ };
17816
+ cookie?: never;
17817
+ };
17818
+ requestBody?: never;
17819
+ responses: {
17820
+ /** @description Import result */
17821
+ 200: {
17822
+ headers: {
17823
+ [name: string]: unknown;
17824
+ };
17825
+ content: {
17826
+ "application/json": components["schemas"]["TeamOwnershipDatadogImportResultDto"];
17827
+ };
17828
+ };
17829
+ 401: components["responses"]["Unauthorized"];
17830
+ 403: components["responses"]["Forbidden"];
17831
+ /** @description Workspace missing or Team Efficiency disabled */
17832
+ 404: {
17833
+ headers: {
17834
+ [name: string]: unknown;
17835
+ };
17836
+ content: {
17837
+ "application/json": components["schemas"]["ErrorMessageDto"];
17838
+ };
17839
+ };
17840
+ /** @description Datadog not connected */
17841
+ 422: {
17842
+ headers: {
17843
+ [name: string]: unknown;
17844
+ };
17845
+ content: {
17846
+ "application/json": components["schemas"]["ErrorMessageDto"];
17847
+ };
17848
+ };
17849
+ /** @description Datadog catalog fetch failed */
17850
+ 503: {
17851
+ headers: {
17852
+ [name: string]: unknown;
17853
+ };
17854
+ content: {
17855
+ "application/json": components["schemas"]["ErrorMessageDto"];
17856
+ };
17857
+ };
17858
+ };
17859
+ };
17615
17860
  getWorkspaceProductivityTargets: {
17616
17861
  parameters: {
17617
17862
  query?: never;