@thinkai/tai-api-contract 2.107.0 → 2.109.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.
@@ -1431,6 +1431,26 @@ export interface paths {
1431
1431
  patch?: never;
1432
1432
  trace?: never;
1433
1433
  };
1434
+ "/workspaces/{workspaceId}/integrations/connectors-snapshot": {
1435
+ parameters: {
1436
+ query?: never;
1437
+ header?: never;
1438
+ path?: never;
1439
+ cookie?: never;
1440
+ };
1441
+ /**
1442
+ * Workspace connectors snapshot for settings UI
1443
+ * @description Returns workspace config plus GitHub App and GitHub Actions integration status in one response (lighter than separate config and integration status calls).
1444
+ */
1445
+ get: operations["getWorkspaceConnectorsSnapshot"];
1446
+ put?: never;
1447
+ post?: never;
1448
+ delete?: never;
1449
+ options?: never;
1450
+ head?: never;
1451
+ patch?: never;
1452
+ trace?: never;
1453
+ };
1434
1454
  "/workspaces/{workspaceId}/integrations/github": {
1435
1455
  parameters: {
1436
1456
  query?: never;
@@ -3307,6 +3327,26 @@ export interface paths {
3307
3327
  patch?: never;
3308
3328
  trace?: never;
3309
3329
  };
3330
+ "/me/app-shell": {
3331
+ parameters: {
3332
+ query?: never;
3333
+ header?: never;
3334
+ path?: never;
3335
+ cookie?: never;
3336
+ };
3337
+ /**
3338
+ * App chrome bootstrap payload
3339
+ * @description Returns the authenticated user's profile, workspace list, and preferences in one response. When `workspaceId` is provided and resolves to a workspace the caller belongs to, also returns platform banner, unread notification count, journey progress, and connectors snapshot. Invalid, unknown, or non-member `workspaceId` values do not produce 403/404 — the response is still 200 with only `me`, `workspaces`, and `preferences` (workspace-scoped fields omitted).
3340
+ */
3341
+ get: operations["getAppShell"];
3342
+ put?: never;
3343
+ post?: never;
3344
+ delete?: never;
3345
+ options?: never;
3346
+ head?: never;
3347
+ patch?: never;
3348
+ trace?: never;
3349
+ };
3310
3350
  "/workspaces/{workspaceId}/org-chart/import": {
3311
3351
  parameters: {
3312
3352
  query?: never;
@@ -3318,7 +3358,7 @@ export interface paths {
3318
3358
  put?: never;
3319
3359
  /**
3320
3360
  * Import org chart from Supabase storage path
3321
- * @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`. Required columns: employee_id, name, email, title, department, team, manager_id, location. Optional: github_username (GitHub login for productivity ingest). Saving the SPA snapshot also materializes a scoring `org_chart` tree for team/person metrics when import members are present.
3361
+ * @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`. Required columns: employee_id, name, email, title, department, team, manager_id, location. Optional: github_username (GitHub login for productivity ingest), bitbucket_nickname, bitbucket_uuid, alternate_emails (comma-separated alternate work emails for AI tool spend attribution). Saving the SPA snapshot also materializes a scoring `org_chart` tree for team/person metrics when import members are present. Parse-only responses may include duplicateEmailWarnings, identityEmailPreview (cross-check against connected AI tool seat rosters), and importWarnings when roster preview is unavailable.
3322
3362
  */
3323
3363
  post: operations["postOrgChartImport"];
3324
3364
  delete?: never;
@@ -3347,6 +3387,26 @@ export interface paths {
3347
3387
  patch?: never;
3348
3388
  trace?: never;
3349
3389
  };
3390
+ "/workspaces/{workspaceId}/your-ai-journey/dashboard-secondary": {
3391
+ parameters: {
3392
+ query?: never;
3393
+ header?: never;
3394
+ path?: never;
3395
+ cookie?: never;
3396
+ };
3397
+ /**
3398
+ * Secondary dashboard panels bootstrap payload
3399
+ * @description Returns readiness aggregate, merged PR trends (8-week default window), aggregated teams (8-week default window), and agentic foundation dashboard in one response. Nested payloads reuse the same builders and caches as their dedicated routes.
3400
+ */
3401
+ get: operations["getYourAiJourneyDashboardSecondary"];
3402
+ put?: never;
3403
+ post?: never;
3404
+ delete?: never;
3405
+ options?: never;
3406
+ head?: never;
3407
+ patch?: never;
3408
+ trace?: never;
3409
+ };
3350
3410
  "/workspaces/{workspaceId}/your-ai-journey/analytics": {
3351
3411
  parameters: {
3352
3412
  query?: never;
@@ -3845,6 +3905,26 @@ export interface components {
3845
3905
  bitbucketNickname?: string;
3846
3906
  /** @description Bitbucket account UUID (e.g. "{aeefb6b0-...}") to attribute merged PRs and reviews to this person in productivity ingest. Preferred over bitbucketNickname — Bitbucket PR payloads expose a stable uuid but not nickname. Resolves to the same person_id (email) as githubUsername. */
3847
3907
  bitbucketUuid?: string;
3908
+ /** @description Optional comma-separated work emails that map to the same person for AI tool spend/usage (mirrors multi-login github_username). Primary email remains canonical person_id. */
3909
+ alternateEmails?: string;
3910
+ };
3911
+ OrgChartEmailOwnershipDto: {
3912
+ email: string;
3913
+ employeeId: string;
3914
+ name: string;
3915
+ isPrimary: boolean;
3916
+ };
3917
+ OrgChartEmailDuplicateDto: {
3918
+ email: string;
3919
+ owners: components["schemas"]["OrgChartEmailOwnershipDto"][];
3920
+ };
3921
+ OrgChartIdentityEmailPreviewDto: {
3922
+ employeeId: string;
3923
+ name: string;
3924
+ primaryEmail: string;
3925
+ alternateEmails: string[];
3926
+ rosterMatches: string[];
3927
+ warnings: string[];
3848
3928
  };
3849
3929
  UpdateMyOrgChartMemberBodyDto: {
3850
3930
  name?: string;
@@ -3855,12 +3935,20 @@ export interface components {
3855
3935
  githubUsername?: string;
3856
3936
  bitbucketNickname?: string;
3857
3937
  bitbucketUuid?: string;
3938
+ /** @description Comma-separated alternate work emails for AI tool attribution. */
3939
+ alternateEmails?: string;
3858
3940
  };
3859
3941
  OrgChartImportResultDto: {
3860
3942
  persons: components["schemas"]["OrgChartPersonDto"][];
3861
3943
  errors: string[];
3862
3944
  /** @description Parse-only preview of identity rows that would not match HRIS persons */
3863
3945
  unmatchedPreview?: components["schemas"]["OrgChartUnmatchedIdentitySampleDto"][];
3946
+ /** @description Emails claimed by more than one org-chart row (primary or alternate) */
3947
+ duplicateEmailWarnings?: components["schemas"]["OrgChartEmailDuplicateDto"][];
3948
+ /** @description Cross-check of primary and alternate emails against connected AI tool seat rosters */
3949
+ identityEmailPreview?: components["schemas"]["OrgChartIdentityEmailPreviewDto"][];
3950
+ /** @description Non-fatal import advisories (for example when AI tool roster preview could not be loaded) */
3951
+ importWarnings?: string[];
3864
3952
  };
3865
3953
  OrgChartSaveResultDto: {
3866
3954
  ok: boolean;
@@ -7096,6 +7184,30 @@ export interface components {
7096
7184
  analytics: components["schemas"]["YourAiJourneyAnalyticsDto"];
7097
7185
  productivity: components["schemas"]["DashboardProductivityDto"];
7098
7186
  };
7187
+ ConnectorsSnapshotDto: {
7188
+ config: components["schemas"]["WorkspaceConfigDto"];
7189
+ github: components["schemas"]["GithubInstallationStatusDto"];
7190
+ githubActions: components["schemas"]["GithubActionsIntegrationStatusDto"];
7191
+ };
7192
+ AppShellDto: {
7193
+ me: components["schemas"]["MeProfileDto"];
7194
+ workspaces: components["schemas"]["WorkspaceSummaryDto"][];
7195
+ preferences: components["schemas"]["PreferencesDto"];
7196
+ banner?: components["schemas"]["PlatformBannerViewDto"];
7197
+ unreadCount?: components["schemas"]["NotificationUnreadCountDto"];
7198
+ journeyProgress?: components["schemas"]["JourneyProgressDto"];
7199
+ connectorsSnapshot?: components["schemas"]["ConnectorsSnapshotDto"];
7200
+ };
7201
+ DashboardSecondaryDto: {
7202
+ /** Format: uuid */
7203
+ workspaceId: string;
7204
+ /** Format: date-time */
7205
+ generatedAt: string;
7206
+ readinessAggregate: components["schemas"]["YourAiJourneyReadinessAggregateDto"];
7207
+ mergedPrTrends: components["schemas"]["ProductivityInsightsMergedPrTrendsDto"];
7208
+ aggregatedTeams: components["schemas"]["ProductivityInsightsAggregatedTeamsDto"];
7209
+ agenticFoundation: components["schemas"]["AgenticFoundationDashboardDto"];
7210
+ };
7099
7211
  YourAiJourneyAnalyticsDto: {
7100
7212
  /** Format: uuid */
7101
7213
  workspaceId: string;
@@ -7137,6 +7249,8 @@ export interface components {
7137
7249
  /** @description GitHub merged PRs in this week bucket still awaiting ship-weight scoring. */
7138
7250
  shipWeightPendingCount?: number;
7139
7251
  tokenCount: number;
7252
+ /** @description AI tool spend attributed to this week bucket (USD cents). */
7253
+ spendCents?: number;
7140
7254
  };
7141
7255
  YourAiJourneyAiSpendDto: {
7142
7256
  /** Format: uuid */
@@ -8484,6 +8598,9 @@ export type OrgChartTreeNodeDto = components['schemas']['OrgChartTreeNodeDto'];
8484
8598
  export type ScoringOrgChartDto = components['schemas']['ScoringOrgChartDto'];
8485
8599
  export type OrgChartDto = components['schemas']['OrgChartDto'];
8486
8600
  export type OrgChartPersonDto = components['schemas']['OrgChartPersonDto'];
8601
+ export type OrgChartEmailOwnershipDto = components['schemas']['OrgChartEmailOwnershipDto'];
8602
+ export type OrgChartEmailDuplicateDto = components['schemas']['OrgChartEmailDuplicateDto'];
8603
+ export type OrgChartIdentityEmailPreviewDto = components['schemas']['OrgChartIdentityEmailPreviewDto'];
8487
8604
  export type UpdateMyOrgChartMemberBodyDto = components['schemas']['UpdateMyOrgChartMemberBodyDto'];
8488
8605
  export type OrgChartImportResultDto = components['schemas']['OrgChartImportResultDto'];
8489
8606
  export type OrgChartSaveResultDto = components['schemas']['OrgChartSaveResultDto'];
@@ -8761,6 +8878,9 @@ export type YourAiJourneyPrSignalsDto = components['schemas']['YourAiJourneyPrSi
8761
8878
  export type YourAiJourneyReadinessDimensionDto = components['schemas']['YourAiJourneyReadinessDimensionDto'];
8762
8879
  export type YourAiJourneyReadinessAggregateDto = components['schemas']['YourAiJourneyReadinessAggregateDto'];
8763
8880
  export type YourAiJourneyHeroDto = components['schemas']['YourAiJourneyHeroDto'];
8881
+ export type ConnectorsSnapshotDto = components['schemas']['ConnectorsSnapshotDto'];
8882
+ export type AppShellDto = components['schemas']['AppShellDto'];
8883
+ export type DashboardSecondaryDto = components['schemas']['DashboardSecondaryDto'];
8764
8884
  export type YourAiJourneyAnalyticsDto = components['schemas']['YourAiJourneyAnalyticsDto'];
8765
8885
  export type YourAiJourneyAiSpendWeekDto = components['schemas']['YourAiJourneyAiSpendWeekDto'];
8766
8886
  export type YourAiJourneyAiSpendDto = components['schemas']['YourAiJourneyAiSpendDto'];
@@ -12923,6 +13043,39 @@ export interface operations {
12923
13043
  };
12924
13044
  };
12925
13045
  };
13046
+ getWorkspaceConnectorsSnapshot: {
13047
+ parameters: {
13048
+ query?: never;
13049
+ header?: never;
13050
+ path: {
13051
+ workspaceId: components["parameters"]["WorkspaceId"];
13052
+ };
13053
+ cookie?: never;
13054
+ };
13055
+ requestBody?: never;
13056
+ responses: {
13057
+ /** @description Connectors snapshot */
13058
+ 200: {
13059
+ headers: {
13060
+ [name: string]: unknown;
13061
+ };
13062
+ content: {
13063
+ "application/json": components["schemas"]["ConnectorsSnapshotDto"];
13064
+ };
13065
+ };
13066
+ 401: components["responses"]["Unauthorized"];
13067
+ 403: components["responses"]["Forbidden"];
13068
+ /** @description Workspace does not exist */
13069
+ 404: {
13070
+ headers: {
13071
+ [name: string]: unknown;
13072
+ };
13073
+ content: {
13074
+ "application/json": components["schemas"]["ErrorMessageDto"];
13075
+ };
13076
+ };
13077
+ };
13078
+ };
12926
13079
  getWorkspaceGithubInstallationStatus: {
12927
13080
  parameters: {
12928
13081
  query?: {
@@ -17482,6 +17635,30 @@ export interface operations {
17482
17635
  401: components["responses"]["Unauthorized"];
17483
17636
  };
17484
17637
  };
17638
+ getAppShell: {
17639
+ parameters: {
17640
+ query?: {
17641
+ /** @description Optional workspace scope for banner, notifications, journey, and connectors. Omitted or unresolvable values yield the base shell without workspace extras. */
17642
+ workspaceId?: string;
17643
+ };
17644
+ header?: never;
17645
+ path?: never;
17646
+ cookie?: never;
17647
+ };
17648
+ requestBody?: never;
17649
+ responses: {
17650
+ /** @description App shell bootstrap payload. Workspace-scoped fields (`banner`, `unreadCount`, `journeyProgress`, `connectorsSnapshot`) appear only when `workspaceId` resolves to a workspace the caller belongs to. */
17651
+ 200: {
17652
+ headers: {
17653
+ [name: string]: unknown;
17654
+ };
17655
+ content: {
17656
+ "application/json": components["schemas"]["AppShellDto"];
17657
+ };
17658
+ };
17659
+ 401: components["responses"]["Unauthorized"];
17660
+ };
17661
+ };
17485
17662
  postOrgChartImport: {
17486
17663
  parameters: {
17487
17664
  query?: never;
@@ -17579,6 +17756,39 @@ export interface operations {
17579
17756
  };
17580
17757
  };
17581
17758
  };
17759
+ getYourAiJourneyDashboardSecondary: {
17760
+ parameters: {
17761
+ query?: never;
17762
+ header?: never;
17763
+ path: {
17764
+ workspaceId: components["parameters"]["WorkspaceId"];
17765
+ };
17766
+ cookie?: never;
17767
+ };
17768
+ requestBody?: never;
17769
+ responses: {
17770
+ /** @description Secondary dashboard bootstrap payload */
17771
+ 200: {
17772
+ headers: {
17773
+ [name: string]: unknown;
17774
+ };
17775
+ content: {
17776
+ "application/json": components["schemas"]["DashboardSecondaryDto"];
17777
+ };
17778
+ };
17779
+ 401: components["responses"]["Unauthorized"];
17780
+ 403: components["responses"]["Forbidden"];
17781
+ /** @description Workspace does not exist */
17782
+ 404: {
17783
+ headers: {
17784
+ [name: string]: unknown;
17785
+ };
17786
+ content: {
17787
+ "application/json": components["schemas"]["ErrorMessageDto"];
17788
+ };
17789
+ };
17790
+ };
17791
+ };
17582
17792
  getYourAiJourneyAnalytics: {
17583
17793
  parameters: {
17584
17794
  query?: never;
package/src/index.ts CHANGED
@@ -3,7 +3,18 @@
3
3
  * The ONLY package the frontend may import.
4
4
  */
5
5
 
6
- import type { AgenticFoundationDashboardDto } from "./generated/openapi.js";
6
+ import type {
7
+ AgenticFoundationDashboardDto,
8
+ GithubActionsIntegrationStatusDto,
9
+ GithubInstallationStatusDto,
10
+ JourneyProgressDto,
11
+ MeProfileDto,
12
+ NotificationUnreadCountDto,
13
+ PlatformBannerViewDto,
14
+ PreferencesDto,
15
+ WorkspaceConfigDto as OpenApiWorkspaceConfigDto,
16
+ WorkspaceSummaryDto,
17
+ } from "./generated/openapi.js";
7
18
 
8
19
  /** Run metadata (window, ruleset, created). M5.4: optional tenantId, personId. */
9
20
  export interface RunMetadataDto {
@@ -1191,6 +1202,34 @@ export interface YourAiJourneyHeroDto {
1191
1202
  productivity: YourAiJourneyProductivityDto;
1192
1203
  }
1193
1204
 
1205
+ /** GitHub + workspace config snapshot for connectors UI (BFF). */
1206
+ export interface ConnectorsSnapshotDto {
1207
+ config: OpenApiWorkspaceConfigDto;
1208
+ github: GithubInstallationStatusDto;
1209
+ githubActions: GithubActionsIntegrationStatusDto;
1210
+ }
1211
+
1212
+ /** Response for GET /me/app-shell — bootstrap payload for app chrome. */
1213
+ export interface AppShellDto {
1214
+ me: MeProfileDto;
1215
+ workspaces: WorkspaceSummaryDto[];
1216
+ preferences: PreferencesDto;
1217
+ banner?: PlatformBannerViewDto;
1218
+ unreadCount?: NotificationUnreadCountDto;
1219
+ journeyProgress?: JourneyProgressDto;
1220
+ connectorsSnapshot?: ConnectorsSnapshotDto;
1221
+ }
1222
+
1223
+ /** Response for GET /workspaces/:workspaceId/your-ai-journey/dashboard-secondary. */
1224
+ export interface DashboardSecondaryDto {
1225
+ workspaceId: string;
1226
+ generatedAt: string;
1227
+ readinessAggregate: YourAiJourneyReadinessAggregateDto;
1228
+ mergedPrTrends: ProductivityInsightsMergedPrTrendsDto;
1229
+ aggregatedTeams: ProductivityInsightsAggregatedTeamsDto;
1230
+ agenticFoundation: AgenticFoundationDashboardDto;
1231
+ }
1232
+
1194
1233
  /** Response for GET /workspaces/:workspaceId/your-ai-journey/agentic-foundation — same shape as AgenticFoundationDashboardDto. */
1195
1234
  export type YourAiJourneyAgenticFoundationDto = AgenticFoundationDashboardDto;
1196
1235
 
@@ -1201,6 +1240,7 @@ export interface YourAiJourneyAiSpendWeekDto {
1201
1240
  weekLabel: string;
1202
1241
  mergedPrCount: number;
1203
1242
  tokenCount: number;
1243
+ spendCents?: number;
1204
1244
  }
1205
1245
 
1206
1246
  /** Response for GET /workspaces/:workspaceId/your-ai-journey/ai-spend */