@thinkai/tai-api-contract 2.57.0 → 2.58.0-pr.901.7f05b4b4

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.
@@ -1,7 +1,7 @@
1
1
  openapi: 3.0.3
2
2
  info:
3
3
  title: ThinkAI API
4
- version: 2.57.0
4
+ version: 2.58.0
5
5
  description: >
6
6
  Contract surface for the AI Driven SDLC backend used by ThinkAI.
7
7
  Workspace-scoped routes use `/workspaces/{workspaceId}/...`.
@@ -5391,6 +5391,31 @@ paths:
5391
5391
  application/json:
5392
5392
  schema:
5393
5393
  $ref: "#/components/schemas/ErrorMessageDto"
5394
+ "422":
5395
+ description: GitHub installation lacks write permissions required for automated fix PRs
5396
+ content:
5397
+ application/json:
5398
+ schema:
5399
+ $ref: "#/components/schemas/GithubWritePermissionsRequiredErrorDto"
5400
+ examples:
5401
+ write_required:
5402
+ value:
5403
+ error: github_write_permissions_required
5404
+ missingPermissions:
5405
+ - name: contents
5406
+ required: write
5407
+ granted: read
5408
+ - name: pull_requests
5409
+ required: write
5410
+ granted: read
5411
+ manageUrl: https://github.com/settings/installations/12345
5412
+ writeUpgradeMessage: Automated fixes need write access to your repositories. Approve on GitHub to enable fix PRs.
5413
+ "503":
5414
+ description: GitHub installation permissions could not be verified
5415
+ content:
5416
+ application/json:
5417
+ schema:
5418
+ $ref: "#/components/schemas/GithubPermissionsCheckFailedErrorDto"
5394
5419
 
5395
5420
  /workspaces/{workspaceId}/readiness/fixes/{fixId}/retrigger:
5396
5421
  post:
@@ -5434,6 +5459,18 @@ paths:
5434
5459
  value:
5435
5460
  error: Fix is currently generating and cannot be superseded
5436
5461
  code: fix_generating
5462
+ "422":
5463
+ description: GitHub installation lacks write permissions required for automated fix PRs
5464
+ content:
5465
+ application/json:
5466
+ schema:
5467
+ $ref: "#/components/schemas/GithubWritePermissionsRequiredErrorDto"
5468
+ "503":
5469
+ description: GitHub installation permissions could not be verified
5470
+ content:
5471
+ application/json:
5472
+ schema:
5473
+ $ref: "#/components/schemas/GithubPermissionsCheckFailedErrorDto"
5437
5474
 
5438
5475
  /workspaces/{workspaceId}/cursor/platform-key-consent:
5439
5476
  put:
@@ -10214,9 +10251,47 @@ components:
10214
10251
  nullable: true
10215
10252
  description: Null when the installation has not granted this permission.
10216
10253
 
10254
+ GithubWritePermissionsRequiredErrorDto:
10255
+ type: object
10256
+ additionalProperties: false
10257
+ required: [error, missingPermissions]
10258
+ properties:
10259
+ error:
10260
+ type: string
10261
+ enum: [github_write_permissions_required]
10262
+ missingPermissions:
10263
+ type: array
10264
+ items:
10265
+ $ref: "#/components/schemas/GithubMissingPermissionDto"
10266
+ manageUrl:
10267
+ type: string
10268
+ nullable: true
10269
+ description: GitHub installation settings URL to approve write permissions.
10270
+ writeUpgradeMessage:
10271
+ type: string
10272
+ nullable: true
10273
+ description: Human-readable summary of the write permission upgrade.
10274
+
10275
+ GithubPermissionsCheckFailedErrorDto:
10276
+ type: object
10277
+ additionalProperties: false
10278
+ required: [error]
10279
+ properties:
10280
+ error:
10281
+ type: string
10282
+ enum: [github_permissions_check_failed]
10283
+ description: GitHub installation permissions could not be verified (transient upstream failure).
10284
+
10217
10285
  GithubInstallationSummaryDto:
10218
10286
  type: object
10219
- required: [installationId, account, repos, permissionsUpgradeRequired]
10287
+ required:
10288
+ - installationId
10289
+ - account
10290
+ - repos
10291
+ - permissionsUpgradeRequired
10292
+ - corePermissionsOk
10293
+ - writePermissionsOk
10294
+ - writePermissionsUpgradeRequired
10220
10295
  properties:
10221
10296
  installationId:
10222
10297
  type: string
@@ -10238,16 +10313,38 @@ components:
10238
10313
  permissionsUpgradeRequired:
10239
10314
  type: boolean
10240
10315
  description: >
10241
- True when this installation's granted permissions are below what the ThinkAI GitHub App
10242
- currently requests.
10316
+ True when this installation lacks core read permissions required for connect and analysis.
10317
+ Alias for `!corePermissionsOk`.
10318
+ corePermissionsOk:
10319
+ type: boolean
10320
+ description: >
10321
+ True when installation grants read permissions for repository analysis (contents, metadata,
10322
+ pull requests, and members for org installs).
10323
+ writePermissionsOk:
10324
+ type: boolean
10325
+ description: >
10326
+ True when installation grants write permissions required for automated fix PRs.
10327
+ writePermissionsUpgradeRequired:
10328
+ type: boolean
10329
+ description: Alias for `!writePermissionsOk`.
10243
10330
  missingPermissions:
10244
10331
  type: array
10245
10332
  items:
10246
10333
  $ref: "#/components/schemas/GithubMissingPermissionDto"
10334
+ description: Core read permissions still needed for connect and analysis.
10335
+ missingWritePermissions:
10336
+ type: array
10337
+ items:
10338
+ $ref: "#/components/schemas/GithubMissingPermissionDto"
10339
+ description: Write permissions still needed for automated fix PRs.
10247
10340
  upgradeMessage:
10248
10341
  type: string
10249
10342
  nullable: true
10250
- description: Human-readable summary for UI when permissionsUpgradeRequired is true.
10343
+ description: Human-readable summary for UI when core permissions are missing.
10344
+ writeUpgradeMessage:
10345
+ type: string
10346
+ nullable: true
10347
+ description: Human-readable summary for UI when write permissions are missing.
10251
10348
 
10252
10349
  GithubPendingApprovalDto:
10253
10350
  type: object
@@ -10361,7 +10458,13 @@ components:
10361
10458
 
10362
10459
  GithubInstallationStatusDto:
10363
10460
  type: object
10364
- required: [installed, installations, permissionsUpgradeRequired]
10461
+ required:
10462
+ - installed
10463
+ - installations
10464
+ - permissionsUpgradeRequired
10465
+ - corePermissionsOk
10466
+ - writePermissionsOk
10467
+ - writePermissionsUpgradeRequired
10365
10468
  properties:
10366
10469
  installed:
10367
10470
  type: boolean
@@ -10371,7 +10474,25 @@ components:
10371
10474
  $ref: "#/components/schemas/GithubInstallationSummaryDto"
10372
10475
  permissionsUpgradeRequired:
10373
10476
  type: boolean
10374
- description: True if any connected installation is under-permissioned.
10477
+ description: True if any connected installation lacks core read permissions. Alias for `!corePermissionsOk`.
10478
+ corePermissionsOk:
10479
+ type: boolean
10480
+ description: True when every connected installation grants core read permissions.
10481
+ writePermissionsOk:
10482
+ type: boolean
10483
+ description: True when every connected installation grants write permissions for automated fixes.
10484
+ writePermissionsUpgradeRequired:
10485
+ type: boolean
10486
+ description: True when any connected installation lacks write permissions for automated fixes.
10487
+ missingWritePermissions:
10488
+ type: array
10489
+ items:
10490
+ $ref: "#/components/schemas/GithubMissingPermissionDto"
10491
+ description: Aggregated write permissions missing on installations that lack write access.
10492
+ writeUpgradeMessage:
10493
+ type: string
10494
+ nullable: true
10495
+ description: Human-readable summary when write permissions are missing.
10375
10496
  pendingApproval:
10376
10497
  nullable: true
10377
10498
  allOf:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thinkai/tai-api-contract",
3
- "version": "2.57.0",
3
+ "version": "2.58.0-pr.901.7f05b4b4",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -4231,6 +4231,22 @@ export interface components {
4231
4231
  */
4232
4232
  granted?: "read" | "write" | "admin" | null;
4233
4233
  };
4234
+ GithubWritePermissionsRequiredErrorDto: {
4235
+ /** @enum {string} */
4236
+ error: "github_write_permissions_required";
4237
+ missingPermissions: components["schemas"]["GithubMissingPermissionDto"][];
4238
+ /** @description GitHub installation settings URL to approve write permissions. */
4239
+ manageUrl?: string | null;
4240
+ /** @description Human-readable summary of the write permission upgrade. */
4241
+ writeUpgradeMessage?: string | null;
4242
+ };
4243
+ GithubPermissionsCheckFailedErrorDto: {
4244
+ /**
4245
+ * @description GitHub installation permissions could not be verified (transient upstream failure).
4246
+ * @enum {string}
4247
+ */
4248
+ error: "github_permissions_check_failed";
4249
+ };
4234
4250
  GithubInstallationSummaryDto: {
4235
4251
  installationId: string;
4236
4252
  account: components["schemas"]["GithubAccountDto"];
@@ -4240,11 +4256,22 @@ export interface components {
4240
4256
  manageUrl?: string | null;
4241
4257
  /** Format: date-time */
4242
4258
  lastSyncedAt?: string | null;
4243
- /** @description True when this installation's granted permissions are below what the ThinkAI GitHub App currently requests. */
4259
+ /** @description True when this installation lacks core read permissions required for connect and analysis. Alias for `!corePermissionsOk`. */
4244
4260
  permissionsUpgradeRequired: boolean;
4261
+ /** @description True when installation grants read permissions for repository analysis (contents, metadata, pull requests, and members for org installs). */
4262
+ corePermissionsOk: boolean;
4263
+ /** @description True when installation grants write permissions required for automated fix PRs. */
4264
+ writePermissionsOk: boolean;
4265
+ /** @description Alias for `!writePermissionsOk`. */
4266
+ writePermissionsUpgradeRequired: boolean;
4267
+ /** @description Core read permissions still needed for connect and analysis. */
4245
4268
  missingPermissions?: components["schemas"]["GithubMissingPermissionDto"][];
4246
- /** @description Human-readable summary for UI when permissionsUpgradeRequired is true. */
4269
+ /** @description Write permissions still needed for automated fix PRs. */
4270
+ missingWritePermissions?: components["schemas"]["GithubMissingPermissionDto"][];
4271
+ /** @description Human-readable summary for UI when core permissions are missing. */
4247
4272
  upgradeMessage?: string | null;
4273
+ /** @description Human-readable summary for UI when write permissions are missing. */
4274
+ writeUpgradeMessage?: string | null;
4248
4275
  };
4249
4276
  GithubPendingApprovalDto: {
4250
4277
  /**
@@ -4312,8 +4339,18 @@ export interface components {
4312
4339
  GithubInstallationStatusDto: {
4313
4340
  installed: boolean;
4314
4341
  installations: components["schemas"]["GithubInstallationSummaryDto"][];
4315
- /** @description True if any connected installation is under-permissioned. */
4342
+ /** @description True if any connected installation lacks core read permissions. Alias for `!corePermissionsOk`. */
4316
4343
  permissionsUpgradeRequired: boolean;
4344
+ /** @description True when every connected installation grants core read permissions. */
4345
+ corePermissionsOk: boolean;
4346
+ /** @description True when every connected installation grants write permissions for automated fixes. */
4347
+ writePermissionsOk: boolean;
4348
+ /** @description True when any connected installation lacks write permissions for automated fixes. */
4349
+ writePermissionsUpgradeRequired: boolean;
4350
+ /** @description Aggregated write permissions missing on installations that lack write access. */
4351
+ missingWritePermissions?: components["schemas"]["GithubMissingPermissionDto"][];
4352
+ /** @description Human-readable summary when write permissions are missing. */
4353
+ writeUpgradeMessage?: string | null;
4317
4354
  /** @description Present when an org admin must approve the GitHub App install request. */
4318
4355
  pendingApproval?: components["schemas"]["GithubPendingApprovalDto"] | null;
4319
4356
  /** @description Present when GitHub connect was started but not completed (install OAuth state or account-picker session still active). Omitted when pendingApproval is set. */
@@ -5835,6 +5872,8 @@ export type RepoEligibilityOverridesDto = components['schemas']['RepoEligibility
5835
5872
  export type WorkspaceRepoEligibilityDto = components['schemas']['WorkspaceRepoEligibilityDto'];
5836
5873
  export type RepoEligibilityLimitsDto = components['schemas']['RepoEligibilityLimitsDto'];
5837
5874
  export type GithubMissingPermissionDto = components['schemas']['GithubMissingPermissionDto'];
5875
+ export type GithubWritePermissionsRequiredErrorDto = components['schemas']['GithubWritePermissionsRequiredErrorDto'];
5876
+ export type GithubPermissionsCheckFailedErrorDto = components['schemas']['GithubPermissionsCheckFailedErrorDto'];
5838
5877
  export type GithubInstallationSummaryDto = components['schemas']['GithubInstallationSummaryDto'];
5839
5878
  export type GithubPendingApprovalDto = components['schemas']['GithubPendingApprovalDto'];
5840
5879
  export type GithubSetupInProgressDto = components['schemas']['GithubSetupInProgressDto'];
@@ -11346,6 +11385,24 @@ export interface operations {
11346
11385
  "application/json": components["schemas"]["ErrorMessageDto"];
11347
11386
  };
11348
11387
  };
11388
+ /** @description GitHub installation lacks write permissions required for automated fix PRs */
11389
+ 422: {
11390
+ headers: {
11391
+ [name: string]: unknown;
11392
+ };
11393
+ content: {
11394
+ "application/json": components["schemas"]["GithubWritePermissionsRequiredErrorDto"];
11395
+ };
11396
+ };
11397
+ /** @description GitHub installation permissions could not be verified */
11398
+ 503: {
11399
+ headers: {
11400
+ [name: string]: unknown;
11401
+ };
11402
+ content: {
11403
+ "application/json": components["schemas"]["GithubPermissionsCheckFailedErrorDto"];
11404
+ };
11405
+ };
11349
11406
  };
11350
11407
  };
11351
11408
  postReadinessFixRetrigger: {
@@ -11389,6 +11446,24 @@ export interface operations {
11389
11446
  "application/json": components["schemas"]["ErrorMessageDto"];
11390
11447
  };
11391
11448
  };
11449
+ /** @description GitHub installation lacks write permissions required for automated fix PRs */
11450
+ 422: {
11451
+ headers: {
11452
+ [name: string]: unknown;
11453
+ };
11454
+ content: {
11455
+ "application/json": components["schemas"]["GithubWritePermissionsRequiredErrorDto"];
11456
+ };
11457
+ };
11458
+ /** @description GitHub installation permissions could not be verified */
11459
+ 503: {
11460
+ headers: {
11461
+ [name: string]: unknown;
11462
+ };
11463
+ content: {
11464
+ "application/json": components["schemas"]["GithubPermissionsCheckFailedErrorDto"];
11465
+ };
11466
+ };
11392
11467
  };
11393
11468
  };
11394
11469
  putCursorPlatformKeyConsent: {