@thinkai/tai-api-contract 2.4.1 → 2.4.4

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.
@@ -826,7 +826,10 @@ export interface paths {
826
826
  path?: never;
827
827
  cookie?: never;
828
828
  };
829
- /** Readiness dimensions catalog */
829
+ /**
830
+ * Readiness dimensions catalog
831
+ * @description Returns static rubric metadata (id, name, description, maxScore) aligned with the readiness scanner dimensions. Does not run scoring on the request path.
832
+ */
830
833
  get: operations["listReadinessDimensions"];
831
834
  put?: never;
832
835
  post?: never;
@@ -843,10 +846,16 @@ export interface paths {
843
846
  path?: never;
844
847
  cookie?: never;
845
848
  };
846
- /** List fix requests */
849
+ /**
850
+ * List fix requests
851
+ * @description Returns persisted fix-queue rows for the workspace (newest first). Empty array when none exist.
852
+ */
847
853
  get: operations["listReadinessFixes"];
848
854
  put?: never;
849
- /** Enqueue fix for an issue */
855
+ /**
856
+ * Enqueue fix for an issue
857
+ * @description Creates a fix request with `status: queued` when `issueId` belongs to `repoId` in this workspace. Requires workspace editor or admin. Re-posting the same `issueId` and `repoId` returns the existing row (idempotent).
858
+ */
850
859
  post: operations["postReadinessFix"];
851
860
  delete?: never;
852
861
  options?: never;
@@ -1023,7 +1032,10 @@ export interface paths {
1023
1032
  };
1024
1033
  get?: never;
1025
1034
  put?: never;
1026
- /** Import org chart from Supabase storage path */
1035
+ /**
1036
+ * Import org chart from Supabase storage path
1037
+ * @description Parse-only. Downloads the CSV at `storagePath` from the `org-charts` bucket and returns `persons` and `errors`. Does not persist to `spa_org_chart` or `org_chart`. The SPA derives teams client-side and saves the org structure via `POST /workspaces/{workspaceId}/org-chart`.
1038
+ */
1027
1039
  post: operations["postOrgChartImport"];
1028
1040
  delete?: never;
1029
1041
  options?: never;
@@ -1057,6 +1069,16 @@ export interface components {
1057
1069
  /** @enum {string} */
1058
1070
  role: "admin" | "editor" | "viewer";
1059
1071
  };
1072
+ OrgChartNodeDto: {
1073
+ id: string;
1074
+ name: string;
1075
+ /** @enum {string} */
1076
+ type: "org" | "department" | "team" | "person";
1077
+ external_ids?: {
1078
+ [key: string]: string;
1079
+ };
1080
+ children?: components["schemas"]["OrgChartNodeDto"][];
1081
+ };
1060
1082
  OrgChartTreeNodeDto: {
1061
1083
  id: string;
1062
1084
  name?: string;
@@ -1070,9 +1092,31 @@ export interface components {
1070
1092
  };
1071
1093
  children?: components["schemas"]["OrgChartTreeNodeDto"][];
1072
1094
  };
1073
- OrgChartDto: {
1095
+ ScoringOrgChartDto: {
1074
1096
  root: components["schemas"]["OrgChartTreeNodeDto"];
1075
1097
  };
1098
+ OrgChartDto: {
1099
+ root: components["schemas"]["OrgChartNodeDto"];
1100
+ };
1101
+ OrgChartPersonDto: {
1102
+ employeeId: string;
1103
+ name: string;
1104
+ email: string;
1105
+ title: string;
1106
+ department: string;
1107
+ team: string;
1108
+ managerId: string;
1109
+ location: string;
1110
+ };
1111
+ OrgChartImportResultDto: {
1112
+ persons: components["schemas"]["OrgChartPersonDto"][];
1113
+ errors: string[];
1114
+ };
1115
+ OrgChartSaveResultDto: {
1116
+ ok: boolean;
1117
+ /** Format: uuid */
1118
+ tenantId: string;
1119
+ };
1076
1120
  TenantSourceEntryDto: {
1077
1121
  type: string;
1078
1122
  } & {
@@ -1093,7 +1137,7 @@ export interface components {
1093
1137
  };
1094
1138
  WorkspaceConfigDto: {
1095
1139
  sources: components["schemas"]["TenantSourceEntryDto"][];
1096
- orgChart?: components["schemas"]["OrgChartDto"] | null;
1140
+ orgChart?: components["schemas"]["ScoringOrgChartDto"] | null;
1097
1141
  /** @enum {string|null} */
1098
1142
  region?: "us" | "eu" | "me" | null;
1099
1143
  };
@@ -1392,6 +1436,11 @@ export interface components {
1392
1436
  };
1393
1437
  /** @enum {string} */
1394
1438
  ReadinessRunStatusDto: "queued" | "running" | "succeeded" | "failed" | "partial_failed";
1439
+ /**
1440
+ * @description Whether an AI readiness analysis run is queued or in progress for this repository slug. `idle` means no `queued`/`running` row exists in `tai_workspace_readiness_runs`.
1441
+ * @enum {string}
1442
+ */
1443
+ ReadinessRepoAnalysisStatusDto: "idle" | "queued" | "running";
1395
1444
  ReadinessRunSummaryDto: {
1396
1445
  /** Format: uuid */
1397
1446
  runId: string;
@@ -1437,6 +1486,12 @@ export interface components {
1437
1486
  /** Format: uuid */
1438
1487
  teamId?: string | null;
1439
1488
  provider: components["schemas"]["RepoProviderDto"];
1489
+ analysisStatus: components["schemas"]["ReadinessRepoAnalysisStatusDto"];
1490
+ /**
1491
+ * Format: uuid
1492
+ * @description Present when `analysisStatus` is `queued` or `running`; use with `GET .../readiness/runs/{runId}`.
1493
+ */
1494
+ activeRunId?: string | null;
1440
1495
  };
1441
1496
  AgenticFoundationDashboardSummaryDto: {
1442
1497
  repoCount: number;
@@ -1485,7 +1540,15 @@ export interface components {
1485
1540
  createdAt: string;
1486
1541
  };
1487
1542
  CreateFixRequestBodyDto: {
1543
+ /**
1544
+ * Format: uuid
1545
+ * @description Readiness issue id from stored scorecard data
1546
+ */
1488
1547
  issueId: string;
1548
+ /**
1549
+ * Format: uuid
1550
+ * @description Workspace repository id that owns the issue
1551
+ */
1489
1552
  repoId: string;
1490
1553
  };
1491
1554
  PhaseRoleDto: {
@@ -1674,8 +1737,13 @@ export type TeamMemberDto = components['schemas']['TeamMemberDto'];
1674
1737
  export type TeamMemberListDto = components['schemas']['TeamMemberListDto'];
1675
1738
  export type InviteTeamMemberBodyDto = components['schemas']['InviteTeamMemberBodyDto'];
1676
1739
  export type UpdateTeamMemberRoleBodyDto = components['schemas']['UpdateTeamMemberRoleBodyDto'];
1740
+ export type OrgChartNodeDto = components['schemas']['OrgChartNodeDto'];
1677
1741
  export type OrgChartTreeNodeDto = components['schemas']['OrgChartTreeNodeDto'];
1742
+ export type ScoringOrgChartDto = components['schemas']['ScoringOrgChartDto'];
1678
1743
  export type OrgChartDto = components['schemas']['OrgChartDto'];
1744
+ export type OrgChartPersonDto = components['schemas']['OrgChartPersonDto'];
1745
+ export type OrgChartImportResultDto = components['schemas']['OrgChartImportResultDto'];
1746
+ export type OrgChartSaveResultDto = components['schemas']['OrgChartSaveResultDto'];
1679
1747
  export type TenantSourceEntryDto = components['schemas']['TenantSourceEntryDto'];
1680
1748
  export type CursorSourceDto = components['schemas']['CursorSourceDto'];
1681
1749
  export type WorkspaceConfigDto = components['schemas']['WorkspaceConfigDto'];
@@ -1717,6 +1785,7 @@ export type RepoProviderDto = components['schemas']['RepoProviderDto'];
1717
1785
  export type ReadinessAnalyzeBodyDto = components['schemas']['ReadinessAnalyzeBodyDto'];
1718
1786
  export type ReadinessAnalyzeResponseDto = components['schemas']['ReadinessAnalyzeResponseDto'];
1719
1787
  export type ReadinessRunStatusDto = components['schemas']['ReadinessRunStatusDto'];
1788
+ export type ReadinessRepoAnalysisStatusDto = components['schemas']['ReadinessRepoAnalysisStatusDto'];
1720
1789
  export type ReadinessRunSummaryDto = components['schemas']['ReadinessRunSummaryDto'];
1721
1790
  export type ReadinessIssueDto = components['schemas']['ReadinessIssueDto'];
1722
1791
  export type DimensionScoreDto = components['schemas']['DimensionScoreDto'];
@@ -1986,9 +2055,7 @@ export interface operations {
1986
2055
  };
1987
2056
  getTenantOrgChart: {
1988
2057
  parameters: {
1989
- query?: {
1990
- withScores?: boolean;
1991
- };
2058
+ query?: never;
1992
2059
  header?: never;
1993
2060
  path: {
1994
2061
  workspaceId: components["parameters"]["WorkspaceId"];
@@ -1997,7 +2064,7 @@ export interface operations {
1997
2064
  };
1998
2065
  requestBody?: never;
1999
2066
  responses: {
2000
- /** @description Org chart (optionally with per-node scores) */
2067
+ /** @description SPA org structure chart (`spa_org_chart`; per-node scores not included — use GET /config for scoring tree) */
2001
2068
  200: {
2002
2069
  headers: {
2003
2070
  [name: string]: unknown;
@@ -2007,6 +2074,7 @@ export interface operations {
2007
2074
  };
2008
2075
  };
2009
2076
  401: components["responses"]["Unauthorized"];
2077
+ 403: components["responses"]["Forbidden"];
2010
2078
  /** @description Workspace not found */
2011
2079
  404: {
2012
2080
  headers: {
@@ -2037,13 +2105,20 @@ export interface operations {
2037
2105
  [name: string]: unknown;
2038
2106
  };
2039
2107
  content: {
2040
- "application/json": {
2041
- ok: boolean;
2042
- workspaceId: string;
2043
- };
2108
+ "application/json": components["schemas"]["OrgChartSaveResultDto"];
2109
+ };
2110
+ };
2111
+ /** @description Invalid request body or chart limits exceeded */
2112
+ 400: {
2113
+ headers: {
2114
+ [name: string]: unknown;
2115
+ };
2116
+ content: {
2117
+ "application/json": components["schemas"]["ErrorMessageDto"];
2044
2118
  };
2045
2119
  };
2046
2120
  401: components["responses"]["Unauthorized"];
2121
+ 403: components["responses"]["Forbidden"];
2047
2122
  };
2048
2123
  };
2049
2124
  getWorkspaceConfig: {
@@ -3535,6 +3610,16 @@ export interface operations {
3535
3610
  };
3536
3611
  };
3537
3612
  401: components["responses"]["Unauthorized"];
3613
+ 403: components["responses"]["Forbidden"];
3614
+ /** @description Workspace does not exist */
3615
+ 404: {
3616
+ headers: {
3617
+ [name: string]: unknown;
3618
+ };
3619
+ content: {
3620
+ "application/json": components["schemas"]["ErrorMessageDto"];
3621
+ };
3622
+ };
3538
3623
  };
3539
3624
  };
3540
3625
  listReadinessFixes: {
@@ -3558,6 +3643,16 @@ export interface operations {
3558
3643
  };
3559
3644
  };
3560
3645
  401: components["responses"]["Unauthorized"];
3646
+ 403: components["responses"]["Forbidden"];
3647
+ /** @description Workspace does not exist */
3648
+ 404: {
3649
+ headers: {
3650
+ [name: string]: unknown;
3651
+ };
3652
+ content: {
3653
+ "application/json": components["schemas"]["ErrorMessageDto"];
3654
+ };
3655
+ };
3561
3656
  };
3562
3657
  };
3563
3658
  postReadinessFix: {
@@ -3575,7 +3670,7 @@ export interface operations {
3575
3670
  };
3576
3671
  };
3577
3672
  responses: {
3578
- /** @description Fix request created */
3673
+ /** @description Fix request created or existing row returned */
3579
3674
  200: {
3580
3675
  headers: {
3581
3676
  [name: string]: unknown;
@@ -3584,7 +3679,26 @@ export interface operations {
3584
3679
  "application/json": components["schemas"]["FixRequestDto"];
3585
3680
  };
3586
3681
  };
3682
+ /** @description Invalid body or malformed `repoId` (not a UUID) */
3683
+ 400: {
3684
+ headers: {
3685
+ [name: string]: unknown;
3686
+ };
3687
+ content: {
3688
+ "application/json": components["schemas"]["ErrorMessageDto"];
3689
+ };
3690
+ };
3587
3691
  401: components["responses"]["Unauthorized"];
3692
+ 403: components["responses"]["Forbidden"];
3693
+ /** @description Workspace not found, or issue/repo pair not in workspace */
3694
+ 404: {
3695
+ headers: {
3696
+ [name: string]: unknown;
3697
+ };
3698
+ content: {
3699
+ "application/json": components["schemas"]["ErrorMessageDto"];
3700
+ };
3701
+ };
3588
3702
  };
3589
3703
  };
3590
3704
  getSquad: {
@@ -3967,18 +4081,53 @@ export interface operations {
3967
4081
  };
3968
4082
  };
3969
4083
  responses: {
3970
- /** @description Parsed persons (shape TBD; align with backend) */
4084
+ /** @description Parsed persons from uploaded CSV (not persisted server-side) */
3971
4085
  200: {
3972
4086
  headers: {
3973
4087
  [name: string]: unknown;
3974
4088
  };
3975
4089
  content: {
3976
- "application/json": {
3977
- [key: string]: unknown;
3978
- };
4090
+ "application/json": components["schemas"]["OrgChartImportResultDto"];
4091
+ };
4092
+ };
4093
+ /** @description Invalid body or storage path */
4094
+ 400: {
4095
+ headers: {
4096
+ [name: string]: unknown;
4097
+ };
4098
+ content: {
4099
+ "application/json": components["schemas"]["ErrorMessageDto"];
3979
4100
  };
3980
4101
  };
3981
4102
  401: components["responses"]["Unauthorized"];
4103
+ 403: components["responses"]["Forbidden"];
4104
+ /** @description Storage object not found */
4105
+ 404: {
4106
+ headers: {
4107
+ [name: string]: unknown;
4108
+ };
4109
+ content: {
4110
+ "application/json": components["schemas"]["ErrorMessageDto"];
4111
+ };
4112
+ };
4113
+ /** @description Failed to download file from storage */
4114
+ 502: {
4115
+ headers: {
4116
+ [name: string]: unknown;
4117
+ };
4118
+ content: {
4119
+ "application/json": components["schemas"]["ErrorMessageDto"];
4120
+ };
4121
+ };
4122
+ /** @description Storage import not configured or service unavailable */
4123
+ 503: {
4124
+ headers: {
4125
+ [name: string]: unknown;
4126
+ };
4127
+ content: {
4128
+ "application/json": components["schemas"]["ErrorMessageDto"];
4129
+ };
4130
+ };
3982
4131
  };
3983
4132
  };
3984
4133
  }
package/src/index.ts CHANGED
@@ -179,18 +179,23 @@ export interface OrgChartTreeNodeDto {
179
179
  external_ids?: Record<string, string>;
180
180
  }
181
181
 
182
- /** Org chart tree node with computed scores (Option B, α=0.2). Used when ?withScores=true. */
182
+ /** Org chart tree node with computed scores (Option B, α=0.2). Reserved for a future scored-tree API. */
183
183
  export interface OrgChartTreeNodeWithScoreDto extends OrgChartTreeNodeDto {
184
184
  score?: number | null;
185
185
  individualUpi?: number | null;
186
186
  children?: OrgChartTreeNodeWithScoreDto[];
187
187
  }
188
188
 
189
- /** M7: Org chart response (tree only). */
189
+ /** M7: Org chart response (tree only). Legacy hand-written shape; prefer generated `OrgChartDto` for SPA routes. */
190
190
  export interface OrgChartDto {
191
191
  root: OrgChartTreeNodeDto;
192
192
  }
193
193
 
194
+ /** Batch scoring person tree returned by GET /workspaces/{workspaceId}/config (`org_chart` column). */
195
+ export interface ScoringOrgChartDto {
196
+ root: OrgChartTreeNodeDto;
197
+ }
198
+
194
199
  /** Summary of a person derived from the tenant's org chart. */
195
200
  export interface PersonSummaryDto {
196
201
  /** Canonical person identifier (e.g. work email). */
@@ -222,7 +227,7 @@ export interface TestConnectionResponseDto {
222
227
  /** Workspace integration config (sources; optionally org chart for Home; optionally region for data residency). */
223
228
  export interface WorkspaceConfigDto {
224
229
  sources: TenantSourceEntryDto[];
225
- orgChart?: OrgChartDto | null;
230
+ orgChart?: ScoringOrgChartDto | null;
226
231
  /** Region for data residency (us, eu, me). Null or absent = legacy/single-region. */
227
232
  region?: string | null;
228
233
  }