@thinkai/tai-api-contract 2.61.0 → 2.62.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.
@@ -1039,7 +1039,7 @@ export interface paths {
1039
1039
  put?: never;
1040
1040
  /**
1041
1041
  * Create GitHub App installation URL
1042
- * @description Creates a GitHub App installation URL scoped to the workspace and caller. Body is optional; when omitted, defaults to `/onboarding/integrations` return path. Optional `pickerSession` (from user OAuth org picker) recovers `returnPath` from the server-side picker snapshot when the multi-hop authorize→install flow should return to the page where OAuth started.
1042
+ * @description Creates a GitHub App installation URL scoped to the workspace and caller. Default intent `connect` installs ThinkAI Platform Insights (read). Intent `enable_fixes` installs ThinkAI Platform Automations (write) for the Insights installation identified by `installationId`. Body is optional; when omitted, defaults to `/onboarding/integrations` return path. Optional `pickerSession` (from user OAuth org picker) recovers `returnPath` from the server-side picker snapshot when the multi-hop authorize→install flow should return to the page where OAuth started.
1043
1043
  */
1044
1044
  post: operations["postGithubInstallUrl"];
1045
1045
  delete?: never;
@@ -1048,6 +1048,46 @@ export interface paths {
1048
1048
  patch?: never;
1049
1049
  trace?: never;
1050
1050
  };
1051
+ "/workspaces/{workspaceId}/integrations/github/installations/{installationId}/automated-fixes/enable": {
1052
+ parameters: {
1053
+ query?: never;
1054
+ header?: never;
1055
+ path?: never;
1056
+ cookie?: never;
1057
+ };
1058
+ get?: never;
1059
+ put?: never;
1060
+ /**
1061
+ * Enable automated fixes for a GitHub installation
1062
+ * @description Workspace-level enable for automated fixes on an Insights (read) installation. If an Automations (write) installation is already linked, flips `automatedFixesEnabled` without reinstalling. Otherwise returns `outcome: needs_install` so the client can call install-url with intent=enable_fixes.
1063
+ */
1064
+ post: operations["postGithubAutomatedFixesEnable"];
1065
+ delete?: never;
1066
+ options?: never;
1067
+ head?: never;
1068
+ patch?: never;
1069
+ trace?: never;
1070
+ };
1071
+ "/workspaces/{workspaceId}/integrations/github/installations/{installationId}/automated-fixes": {
1072
+ parameters: {
1073
+ query?: never;
1074
+ header?: never;
1075
+ path?: never;
1076
+ cookie?: never;
1077
+ };
1078
+ get?: never;
1079
+ put?: never;
1080
+ post?: never;
1081
+ /**
1082
+ * Disable automated fixes for a GitHub installation
1083
+ * @description Workspace-level disable. Clears `automatedFixesEnabled` but keeps the linked Automations write installation id so re-enable does not require reinstall. Does not uninstall the Automations app from GitHub.
1084
+ */
1085
+ delete: operations["deleteGithubAutomatedFixes"];
1086
+ options?: never;
1087
+ head?: never;
1088
+ patch?: never;
1089
+ trace?: never;
1090
+ };
1051
1091
  "/workspaces/{workspaceId}/integrations/github/user-authorize-url": {
1052
1092
  parameters: {
1053
1093
  query?: never;
@@ -2466,6 +2506,26 @@ export interface paths {
2466
2506
  patch?: never;
2467
2507
  trace?: never;
2468
2508
  };
2509
+ "/workspaces/{workspaceId}/your-ai-journey/hero": {
2510
+ parameters: {
2511
+ query?: never;
2512
+ header?: never;
2513
+ path?: never;
2514
+ cookie?: never;
2515
+ };
2516
+ /**
2517
+ * First-paint hero payload for the /dashboard page
2518
+ * @description Returns analytics and productivity in one response so the dashboard hero can paint with a single RTT (auth + membership checked once). Nested payloads match the dedicated analytics and productivity routes and reuse those routes' 60s caches (there is no separate hero-level cache). `generatedAt` on the hero envelope and both nested payloads is set to the same assembly timestamp.
2519
+ */
2520
+ get: operations["getYourAiJourneyHero"];
2521
+ put?: never;
2522
+ post?: never;
2523
+ delete?: never;
2524
+ options?: never;
2525
+ head?: never;
2526
+ patch?: never;
2527
+ trace?: never;
2528
+ };
2469
2529
  "/workspaces/{workspaceId}/your-ai-journey/analytics": {
2470
2530
  parameters: {
2471
2531
  query?: never;
@@ -4489,6 +4549,22 @@ export interface components {
4489
4549
  */
4490
4550
  granted?: "read" | "write" | "admin" | null;
4491
4551
  };
4552
+ GithubWritePermissionsRequiredErrorDto: {
4553
+ /** @enum {string} */
4554
+ error: "github_write_permissions_required";
4555
+ missingPermissions: components["schemas"]["GithubMissingPermissionDto"][];
4556
+ /** @description GitHub installation settings URL to approve write permissions. */
4557
+ manageUrl?: string | null;
4558
+ /** @description Human-readable summary of the write permission upgrade. */
4559
+ writeUpgradeMessage?: string | null;
4560
+ };
4561
+ GithubPermissionsCheckFailedErrorDto: {
4562
+ /**
4563
+ * @description GitHub installation permissions could not be verified (transient upstream failure).
4564
+ * @enum {string}
4565
+ */
4566
+ error: "github_permissions_check_failed";
4567
+ };
4492
4568
  GithubInstallationSummaryDto: {
4493
4569
  installationId: string;
4494
4570
  account: components["schemas"]["GithubAccountDto"];
@@ -4498,11 +4574,35 @@ export interface components {
4498
4574
  manageUrl?: string | null;
4499
4575
  /** Format: date-time */
4500
4576
  lastSyncedAt?: string | null;
4501
- /** @description True when this installation's granted permissions are below what the ThinkAI GitHub App currently requests. */
4577
+ /** @description True when this installation lacks core read permissions required for connect and analysis. Alias for `!corePermissionsOk`. */
4502
4578
  permissionsUpgradeRequired: boolean;
4579
+ /** @description True when installation grants read permissions for repository analysis (contents, metadata, pull requests, and members for org installs). */
4580
+ corePermissionsOk: boolean;
4581
+ /** @description True when automated fixes are enabled and the linked Automations (write) installation grants write permissions required for fix PRs. */
4582
+ writePermissionsOk: boolean;
4583
+ /** @description Alias for `!writePermissionsOk`. */
4584
+ writePermissionsUpgradeRequired: boolean;
4585
+ /** @description Core read permissions still needed for connect and analysis. */
4503
4586
  missingPermissions?: components["schemas"]["GithubMissingPermissionDto"][];
4504
- /** @description Human-readable summary for UI when permissionsUpgradeRequired is true. */
4587
+ /** @description Write permissions still needed for automated fix PRs. */
4588
+ missingWritePermissions?: components["schemas"]["GithubMissingPermissionDto"][];
4589
+ /** @description Human-readable summary for UI when core permissions are missing. */
4505
4590
  upgradeMessage?: string | null;
4591
+ /** @description Human-readable summary for UI when write permissions are missing. */
4592
+ writeUpgradeMessage?: string | null;
4593
+ /** @description True when this workspace has enabled automated fixes for this Insights (read) installation and linked a ThinkAI Platform Automations (write) installation. */
4594
+ automatedFixesEnabled: boolean;
4595
+ /** @description True when an Automations (write) GitHub App installation is linked. */
4596
+ writeAppInstalled: boolean;
4597
+ /** @description GitHub installation id for the Automations (write) app, when linked. */
4598
+ writeInstallationId?: string | null;
4599
+ /**
4600
+ * Format: uri
4601
+ * @description GitHub settings URL for the Automations (write) installation.
4602
+ */
4603
+ writeManageUrl?: string | null;
4604
+ /** @description True when the Automations app is configured and automated fixes are not yet enabled for this installation (UI may show Enable automated fixes). */
4605
+ canEnableAutomatedFixes: boolean;
4506
4606
  };
4507
4607
  GithubPendingApprovalDto: {
4508
4608
  /**
@@ -4658,8 +4758,18 @@ export interface components {
4658
4758
  GithubInstallationStatusDto: {
4659
4759
  installed: boolean;
4660
4760
  installations: components["schemas"]["GithubInstallationSummaryDto"][];
4661
- /** @description True if any connected installation is under-permissioned. */
4761
+ /** @description True if any connected installation lacks core read permissions. Alias for `!corePermissionsOk`. */
4662
4762
  permissionsUpgradeRequired: boolean;
4763
+ /** @description True when every connected installation grants core read permissions. */
4764
+ corePermissionsOk: boolean;
4765
+ /** @description True when every connected installation grants write permissions for automated fixes. */
4766
+ writePermissionsOk: boolean;
4767
+ /** @description True when any connected installation lacks write permissions for automated fixes. */
4768
+ writePermissionsUpgradeRequired: boolean;
4769
+ /** @description Aggregated write permissions missing on installations that lack write access. */
4770
+ missingWritePermissions?: components["schemas"]["GithubMissingPermissionDto"][];
4771
+ /** @description Human-readable summary when write permissions are missing. */
4772
+ writeUpgradeMessage?: string | null;
4663
4773
  /** @description Present when an org admin must approve the GitHub App install request. */
4664
4774
  pendingApproval?: components["schemas"]["GithubPendingApprovalDto"] | null;
4665
4775
  /** @description Present when GitHub connect was started but not completed (install OAuth state or account-picker session still active). Omitted when pendingApproval is set. */
@@ -4699,12 +4809,28 @@ export interface components {
4699
4809
  * @description SPA origin to redirect back to after OAuth; must match server spaOrigins allowlist.
4700
4810
  */
4701
4811
  spaOrigin?: string;
4812
+ /**
4813
+ * @description connect installs ThinkAI Platform Insights (read). enable_fixes installs ThinkAI Platform Automations (write) for the Insights installation identified by installationId.
4814
+ * @enum {string}
4815
+ */
4816
+ intent?: "connect" | "enable_fixes";
4817
+ /** @description Insights (read) installation id required when intent is enable_fixes. */
4818
+ installationId?: string;
4702
4819
  };
4703
4820
  GithubInstallUrlResponseDto: {
4704
4821
  /** Format: uri */
4705
4822
  url: string;
4706
4823
  state: string;
4707
4824
  };
4825
+ GithubAutomatedFixesEnableResponseDto: {
4826
+ /**
4827
+ * @description enabled — write app already linked and flag flipped; needs_install — client should call install-url with intent=enable_fixes.
4828
+ * @enum {string}
4829
+ */
4830
+ outcome: "enabled" | "needs_install";
4831
+ /** @description Present when outcome is enabled. */
4832
+ status?: components["schemas"]["GithubInstallationStatusDto"];
4833
+ };
4708
4834
  GithubUserAuthorizeUrlRequestDto: {
4709
4835
  returnPath?: string;
4710
4836
  /**
@@ -5617,6 +5743,17 @@ export interface components {
5617
5743
  totalFixedIssues: number;
5618
5744
  };
5619
5745
  };
5746
+ YourAiJourneyHeroDto: {
5747
+ /** Format: uuid */
5748
+ workspaceId: string;
5749
+ /**
5750
+ * Format: date-time
5751
+ * @description Assembly timestamp for this hero response; also written onto analytics.generatedAt and productivity.generatedAt so all three match.
5752
+ */
5753
+ generatedAt: string;
5754
+ analytics: components["schemas"]["YourAiJourneyAnalyticsDto"];
5755
+ productivity: components["schemas"]["DashboardProductivityDto"];
5756
+ };
5620
5757
  YourAiJourneyAnalyticsDto: {
5621
5758
  /** Format: uuid */
5622
5759
  workspaceId: string;
@@ -6214,6 +6351,8 @@ export type RepoEligibilityOverridesDto = components['schemas']['RepoEligibility
6214
6351
  export type WorkspaceRepoEligibilityDto = components['schemas']['WorkspaceRepoEligibilityDto'];
6215
6352
  export type RepoEligibilityLimitsDto = components['schemas']['RepoEligibilityLimitsDto'];
6216
6353
  export type GithubMissingPermissionDto = components['schemas']['GithubMissingPermissionDto'];
6354
+ export type GithubWritePermissionsRequiredErrorDto = components['schemas']['GithubWritePermissionsRequiredErrorDto'];
6355
+ export type GithubPermissionsCheckFailedErrorDto = components['schemas']['GithubPermissionsCheckFailedErrorDto'];
6217
6356
  export type GithubInstallationSummaryDto = components['schemas']['GithubInstallationSummaryDto'];
6218
6357
  export type GithubPendingApprovalDto = components['schemas']['GithubPendingApprovalDto'];
6219
6358
  export type GithubSetupInProgressDto = components['schemas']['GithubSetupInProgressDto'];
@@ -6229,6 +6368,7 @@ export type GithubActionsEnableResponseDto = components['schemas']['GithubAction
6229
6368
  export type GithubInstallationStatusDto = components['schemas']['GithubInstallationStatusDto'];
6230
6369
  export type GithubInstallUrlRequestDto = components['schemas']['GithubInstallUrlRequestDto'];
6231
6370
  export type GithubInstallUrlResponseDto = components['schemas']['GithubInstallUrlResponseDto'];
6371
+ export type GithubAutomatedFixesEnableResponseDto = components['schemas']['GithubAutomatedFixesEnableResponseDto'];
6232
6372
  export type GithubUserAuthorizeUrlRequestDto = components['schemas']['GithubUserAuthorizeUrlRequestDto'];
6233
6373
  export type GithubUserAuthorizeUrlResponseDto = components['schemas']['GithubUserAuthorizeUrlResponseDto'];
6234
6374
  export type GithubConnectableAccountDto = components['schemas']['GithubConnectableAccountDto'];
@@ -6327,6 +6467,7 @@ export type YourAiJourneyPrSignalsWeekDto = components['schemas']['YourAiJourney
6327
6467
  export type YourAiJourneyPrSignalsDto = components['schemas']['YourAiJourneyPrSignalsDto'];
6328
6468
  export type YourAiJourneyReadinessDimensionDto = components['schemas']['YourAiJourneyReadinessDimensionDto'];
6329
6469
  export type YourAiJourneyReadinessAggregateDto = components['schemas']['YourAiJourneyReadinessAggregateDto'];
6470
+ export type YourAiJourneyHeroDto = components['schemas']['YourAiJourneyHeroDto'];
6330
6471
  export type YourAiJourneyAnalyticsDto = components['schemas']['YourAiJourneyAnalyticsDto'];
6331
6472
  export type YourAiJourneyAiSpendWeekDto = components['schemas']['YourAiJourneyAiSpendWeekDto'];
6332
6473
  export type YourAiJourneyAiSpendDto = components['schemas']['YourAiJourneyAiSpendDto'];
@@ -9332,6 +9473,90 @@ export interface operations {
9332
9473
  "application/json": components["schemas"]["ErrorMessageDto"];
9333
9474
  };
9334
9475
  };
9476
+ /** @description Requested GitHub App is not configured */
9477
+ 503: {
9478
+ headers: {
9479
+ [name: string]: unknown;
9480
+ };
9481
+ content: {
9482
+ "application/json": components["schemas"]["ErrorMessageDto"];
9483
+ };
9484
+ };
9485
+ };
9486
+ };
9487
+ postGithubAutomatedFixesEnable: {
9488
+ parameters: {
9489
+ query?: never;
9490
+ header?: never;
9491
+ path: {
9492
+ workspaceId: components["parameters"]["WorkspaceId"];
9493
+ installationId: string;
9494
+ };
9495
+ cookie?: never;
9496
+ };
9497
+ requestBody?: never;
9498
+ responses: {
9499
+ /** @description Enable result */
9500
+ 200: {
9501
+ headers: {
9502
+ [name: string]: unknown;
9503
+ };
9504
+ content: {
9505
+ "application/json": components["schemas"]["GithubAutomatedFixesEnableResponseDto"];
9506
+ };
9507
+ };
9508
+ 401: components["responses"]["Unauthorized"];
9509
+ 403: components["responses"]["Forbidden"];
9510
+ /** @description Workspace or installation not found */
9511
+ 404: {
9512
+ headers: {
9513
+ [name: string]: unknown;
9514
+ };
9515
+ content: {
9516
+ "application/json": components["schemas"]["ErrorMessageDto"];
9517
+ };
9518
+ };
9519
+ /** @description Automations GitHub App not configured */
9520
+ 503: {
9521
+ headers: {
9522
+ [name: string]: unknown;
9523
+ };
9524
+ content: {
9525
+ "application/json": components["schemas"]["ErrorMessageDto"];
9526
+ };
9527
+ };
9528
+ };
9529
+ };
9530
+ deleteGithubAutomatedFixes: {
9531
+ parameters: {
9532
+ query?: never;
9533
+ header?: never;
9534
+ path: {
9535
+ workspaceId: components["parameters"]["WorkspaceId"];
9536
+ installationId: string;
9537
+ };
9538
+ cookie?: never;
9539
+ };
9540
+ requestBody?: never;
9541
+ responses: {
9542
+ /** @description Automated fixes disabled (or already disabled) */
9543
+ 204: {
9544
+ headers: {
9545
+ [name: string]: unknown;
9546
+ };
9547
+ content?: never;
9548
+ };
9549
+ 401: components["responses"]["Unauthorized"];
9550
+ 403: components["responses"]["Forbidden"];
9551
+ /** @description Workspace or installation not found */
9552
+ 404: {
9553
+ headers: {
9554
+ [name: string]: unknown;
9555
+ };
9556
+ content: {
9557
+ "application/json": components["schemas"]["ErrorMessageDto"];
9558
+ };
9559
+ };
9335
9560
  };
9336
9561
  };
9337
9562
  postGithubUserAuthorizeUrl: {
@@ -11988,6 +12213,24 @@ export interface operations {
11988
12213
  "application/json": components["schemas"]["ErrorMessageDto"];
11989
12214
  };
11990
12215
  };
12216
+ /** @description GitHub installation lacks write permissions required for automated fix PRs */
12217
+ 422: {
12218
+ headers: {
12219
+ [name: string]: unknown;
12220
+ };
12221
+ content: {
12222
+ "application/json": components["schemas"]["GithubWritePermissionsRequiredErrorDto"];
12223
+ };
12224
+ };
12225
+ /** @description GitHub installation permissions could not be verified */
12226
+ 503: {
12227
+ headers: {
12228
+ [name: string]: unknown;
12229
+ };
12230
+ content: {
12231
+ "application/json": components["schemas"]["GithubPermissionsCheckFailedErrorDto"];
12232
+ };
12233
+ };
11991
12234
  };
11992
12235
  };
11993
12236
  postReadinessFixRetrigger: {
@@ -12031,6 +12274,24 @@ export interface operations {
12031
12274
  "application/json": components["schemas"]["ErrorMessageDto"];
12032
12275
  };
12033
12276
  };
12277
+ /** @description GitHub installation lacks write permissions required for automated fix PRs */
12278
+ 422: {
12279
+ headers: {
12280
+ [name: string]: unknown;
12281
+ };
12282
+ content: {
12283
+ "application/json": components["schemas"]["GithubWritePermissionsRequiredErrorDto"];
12284
+ };
12285
+ };
12286
+ /** @description GitHub installation permissions could not be verified */
12287
+ 503: {
12288
+ headers: {
12289
+ [name: string]: unknown;
12290
+ };
12291
+ content: {
12292
+ "application/json": components["schemas"]["GithubPermissionsCheckFailedErrorDto"];
12293
+ };
12294
+ };
12034
12295
  };
12035
12296
  };
12036
12297
  putCursorPlatformKeyConsent: {
@@ -12774,6 +13035,39 @@ export interface operations {
12774
13035
  };
12775
13036
  };
12776
13037
  };
13038
+ getYourAiJourneyHero: {
13039
+ parameters: {
13040
+ query?: never;
13041
+ header?: never;
13042
+ path: {
13043
+ workspaceId: components["parameters"]["WorkspaceId"];
13044
+ };
13045
+ cookie?: never;
13046
+ };
13047
+ requestBody?: never;
13048
+ responses: {
13049
+ /** @description Hero bootstrap payload */
13050
+ 200: {
13051
+ headers: {
13052
+ [name: string]: unknown;
13053
+ };
13054
+ content: {
13055
+ "application/json": components["schemas"]["YourAiJourneyHeroDto"];
13056
+ };
13057
+ };
13058
+ 401: components["responses"]["Unauthorized"];
13059
+ 403: components["responses"]["Forbidden"];
13060
+ /** @description Workspace does not exist */
13061
+ 404: {
13062
+ headers: {
13063
+ [name: string]: unknown;
13064
+ };
13065
+ content: {
13066
+ "application/json": components["schemas"]["ErrorMessageDto"];
13067
+ };
13068
+ };
13069
+ };
13070
+ };
12777
13071
  getYourAiJourneyAnalytics: {
12778
13072
  parameters: {
12779
13073
  query?: never;
package/src/index.ts CHANGED
@@ -1145,6 +1145,14 @@ export interface YourAiJourneyAnalyticsDto {
1145
1145
  /** Response for GET /workspaces/:workspaceId/your-ai-journey/productivity — same shape as DashboardProductivityDto. */
1146
1146
  export type YourAiJourneyProductivityDto = DashboardProductivityDto;
1147
1147
 
1148
+ /** Response for GET /workspaces/:workspaceId/your-ai-journey/hero — first-paint BFF. */
1149
+ export interface YourAiJourneyHeroDto {
1150
+ workspaceId: string;
1151
+ generatedAt: string;
1152
+ analytics: YourAiJourneyAnalyticsDto;
1153
+ productivity: YourAiJourneyProductivityDto;
1154
+ }
1155
+
1148
1156
  /** Response for GET /workspaces/:workspaceId/your-ai-journey/agentic-foundation — same shape as AgenticFoundationDashboardDto. */
1149
1157
  export type YourAiJourneyAgenticFoundationDto = AgenticFoundationDashboardDto;
1150
1158