@thinkai/tai-api-contract 2.58.0-pr.901.7f05b4b4 → 2.59.0-pr.902.165e0e69

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.
@@ -1356,6 +1356,46 @@ export interface paths {
1356
1356
  patch?: never;
1357
1357
  trace?: never;
1358
1358
  };
1359
+ "/workspaces/{workspaceId}/integrations/newrelic": {
1360
+ parameters: {
1361
+ query?: never;
1362
+ header?: never;
1363
+ path?: never;
1364
+ cookie?: never;
1365
+ };
1366
+ /**
1367
+ * New Relic monitoring integration status
1368
+ * @description Returns whether New Relic is connected for the workspace and the last monitoring ingest sync outcome (issues/deployments pulled into Quality and DORA metrics).
1369
+ */
1370
+ get: operations["getWorkspaceNewRelicIntegrationStatus"];
1371
+ put?: never;
1372
+ post?: never;
1373
+ delete?: never;
1374
+ options?: never;
1375
+ head?: never;
1376
+ patch?: never;
1377
+ trace?: never;
1378
+ };
1379
+ "/workspaces/{workspaceId}/integrations/newrelic/sync": {
1380
+ parameters: {
1381
+ query?: never;
1382
+ header?: never;
1383
+ path?: never;
1384
+ cookie?: never;
1385
+ };
1386
+ get?: never;
1387
+ put?: never;
1388
+ /**
1389
+ * Trigger New Relic monitoring ingest now
1390
+ * @description Manually polls New Relic for alert issues and deployment markers, persists canonical monitoring events, and refreshes org-level Quality/DORA dashboard buckets. Requires editor role.
1391
+ */
1392
+ post: operations["postWorkspaceNewRelicIntegrationSync"];
1393
+ delete?: never;
1394
+ options?: never;
1395
+ head?: never;
1396
+ patch?: never;
1397
+ trace?: never;
1398
+ };
1359
1399
  "/integrations/github/webhook": {
1360
1400
  parameters: {
1361
1401
  query?: never;
@@ -2829,6 +2869,43 @@ export interface components {
2829
2869
  /** @description Masked preview of the stored insights key (prefix + last four characters). Never includes the full secret. */
2830
2870
  insightsTokenHint?: string;
2831
2871
  };
2872
+ /** @description New Relic monitoring source for `PUT /workspaces/{workspaceId}/sources` and `POST /workspaces/{workspaceId}/sources/test`. Requires a User API key and numeric account ID. */
2873
+ NewRelicSourceDto: {
2874
+ /** @enum {string} */
2875
+ type: "newrelic";
2876
+ /** @description Numeric New Relic account ID. */
2877
+ accountId: string;
2878
+ /** @description New Relic User API key (write-only on PUT). */
2879
+ token: string;
2880
+ /**
2881
+ * @description NerdGraph data region (`api.newrelic.com` or `api.eu.newrelic.com`).
2882
+ * @default us
2883
+ * @enum {string}
2884
+ */
2885
+ region: "us" | "eu";
2886
+ /** @description Optional display name returned from a successful connection test. */
2887
+ accountName?: string;
2888
+ /** @description Optional New Relic user name returned from a successful connection test. */
2889
+ userName?: string;
2890
+ };
2891
+ /** @description Redacted New Relic source returned by `GET /workspaces/{workspaceId}/config`. Raw token is never returned. */
2892
+ NewRelicSourceConfigDto: {
2893
+ /** @enum {string} */
2894
+ type: "newrelic";
2895
+ /** @description Whether a User API key is stored for this workspace. */
2896
+ hasToken: boolean;
2897
+ /** @description Configured New Relic account ID. */
2898
+ accountId: string;
2899
+ /**
2900
+ * @description Configured NerdGraph data region.
2901
+ * @enum {string}
2902
+ */
2903
+ region: "us" | "eu";
2904
+ /** @description Account display name when known from the last successful verify. */
2905
+ accountName?: string;
2906
+ /** @description New Relic user name when known from the last successful verify. */
2907
+ userName?: string;
2908
+ };
2832
2909
  /**
2833
2910
  * @description The agent execution account used for Agentic Foundation runs (readiness scanner + fix queue). Exactly one is active per workspace.
2834
2911
  * - `thinkai_platform_cursor`: ThinkAI platform Cursor key (Cursor Agent CLI) — opt-in, never default.
@@ -2838,7 +2915,7 @@ export interface components {
2838
2915
  */
2839
2916
  AgentExecutionProviderDto: "thinkai_platform_cursor" | "cursor_user_api_key" | "claude_api_key";
2840
2917
  WorkspaceConfigDto: {
2841
- sources: (components["schemas"]["CursorSourceConfigDto"] | components["schemas"]["ClaudeSourceConfigDto"] | components["schemas"]["TenantSourceEntryDto"])[];
2918
+ sources: (components["schemas"]["CursorSourceConfigDto"] | components["schemas"]["ClaudeSourceConfigDto"] | components["schemas"]["NewRelicSourceConfigDto"] | components["schemas"]["TenantSourceEntryDto"])[];
2842
2919
  orgChart?: components["schemas"]["ScoringOrgChartDto"] | null;
2843
2920
  /** @enum {string|null} */
2844
2921
  region?: "us" | "eu" | "me" | null;
@@ -2857,6 +2934,12 @@ export interface components {
2857
2934
  executionKeyValid?: boolean | null;
2858
2935
  /** @description Error detail when `executionKeyValid` is false. */
2859
2936
  executionKeyError?: string | null;
2937
+ /** @description Present for New Relic verify success — authenticated New Relic user name. */
2938
+ userName?: string;
2939
+ /** @description Present for New Relic verify success — resolved account display name. */
2940
+ accountName?: string;
2941
+ /** @description Present for New Relic verify success — resolved account ID. */
2942
+ accountId?: string;
2860
2943
  };
2861
2944
  CursorKeyUsageDto: {
2862
2945
  /** @description Readiness runs this calendar month that used the ThinkAI platform Cursor key. */
@@ -4230,22 +4313,6 @@ export interface components {
4230
4313
  */
4231
4314
  granted?: "read" | "write" | "admin" | null;
4232
4315
  };
4233
- GithubWritePermissionsRequiredErrorDto: {
4234
- /** @enum {string} */
4235
- error: "github_write_permissions_required";
4236
- missingPermissions: components["schemas"]["GithubMissingPermissionDto"][];
4237
- /** @description GitHub installation settings URL to approve write permissions. */
4238
- manageUrl?: string | null;
4239
- /** @description Human-readable summary of the write permission upgrade. */
4240
- writeUpgradeMessage?: string | null;
4241
- };
4242
- GithubPermissionsCheckFailedErrorDto: {
4243
- /**
4244
- * @description GitHub installation permissions could not be verified (transient upstream failure).
4245
- * @enum {string}
4246
- */
4247
- error: "github_permissions_check_failed";
4248
- };
4249
4316
  GithubInstallationSummaryDto: {
4250
4317
  installationId: string;
4251
4318
  account: components["schemas"]["GithubAccountDto"];
@@ -4255,22 +4322,11 @@ export interface components {
4255
4322
  manageUrl?: string | null;
4256
4323
  /** Format: date-time */
4257
4324
  lastSyncedAt?: string | null;
4258
- /** @description True when this installation lacks core read permissions required for connect and analysis. Alias for `!corePermissionsOk`. */
4325
+ /** @description True when this installation's granted permissions are below what the ThinkAI GitHub App currently requests. */
4259
4326
  permissionsUpgradeRequired: boolean;
4260
- /** @description True when installation grants read permissions for repository analysis (contents, metadata, pull requests, and members for org installs). */
4261
- corePermissionsOk: boolean;
4262
- /** @description True when installation grants write permissions required for automated fix PRs. */
4263
- writePermissionsOk: boolean;
4264
- /** @description Alias for `!writePermissionsOk`. */
4265
- writePermissionsUpgradeRequired: boolean;
4266
- /** @description Core read permissions still needed for connect and analysis. */
4267
4327
  missingPermissions?: components["schemas"]["GithubMissingPermissionDto"][];
4268
- /** @description Write permissions still needed for automated fix PRs. */
4269
- missingWritePermissions?: components["schemas"]["GithubMissingPermissionDto"][];
4270
- /** @description Human-readable summary for UI when core permissions are missing. */
4328
+ /** @description Human-readable summary for UI when permissionsUpgradeRequired is true. */
4271
4329
  upgradeMessage?: string | null;
4272
- /** @description Human-readable summary for UI when write permissions are missing. */
4273
- writeUpgradeMessage?: string | null;
4274
4330
  };
4275
4331
  GithubPendingApprovalDto: {
4276
4332
  /**
@@ -4329,6 +4385,43 @@ export interface components {
4329
4385
  /** @description Last enable or status error message when applicable. */
4330
4386
  error?: string | null;
4331
4387
  };
4388
+ NewRelicIntegrationStatusDto: {
4389
+ /** @description True when a type:newrelic workspace source is configured. */
4390
+ connected: boolean;
4391
+ /**
4392
+ * Format: date-time
4393
+ * @description Timestamp of the last monitoring ingest attempt (success or failure).
4394
+ */
4395
+ lastSyncAt?: string | null;
4396
+ /**
4397
+ * @description Outcome of the most recent sync (`never` when not yet synced).
4398
+ * @enum {string}
4399
+ */
4400
+ status: "ok" | "error" | "never";
4401
+ lastError?: string | null;
4402
+ /** @description Issues fetched on the last successful sync. */
4403
+ issueCount?: number | null;
4404
+ /** @description Deployment markers fetched on the last successful sync. */
4405
+ deploymentCount?: number | null;
4406
+ /** @description Canonical monitoring events upserted on the last successful sync. */
4407
+ eventCount?: number | null;
4408
+ };
4409
+ NewRelicTriggerSyncResultDto: {
4410
+ /** @enum {string} */
4411
+ status: "ok" | "skipped" | "error";
4412
+ /** @description Stable machine-readable code (e.g. `newrelic_not_connected`). */
4413
+ code?: string;
4414
+ /** @description Human-readable skip reason when status is skipped. */
4415
+ reason?: string;
4416
+ issueCount?: number;
4417
+ deploymentCount?: number;
4418
+ eventCount?: number;
4419
+ /** @description Weekly dashboard metric buckets updated from monitoring events. */
4420
+ bucketsWritten?: number;
4421
+ durationMs?: number;
4422
+ /** @description Error message when status is error. */
4423
+ error?: string;
4424
+ };
4332
4425
  GithubActionsEnableResponseDto: {
4333
4426
  /** @enum {string} */
4334
4427
  outcome: "enabled" | "needs_github" | "permissions_missing" | "error";
@@ -4338,18 +4431,8 @@ export interface components {
4338
4431
  GithubInstallationStatusDto: {
4339
4432
  installed: boolean;
4340
4433
  installations: components["schemas"]["GithubInstallationSummaryDto"][];
4341
- /** @description True if any connected installation lacks core read permissions. Alias for `!corePermissionsOk`. */
4434
+ /** @description True if any connected installation is under-permissioned. */
4342
4435
  permissionsUpgradeRequired: boolean;
4343
- /** @description True when every connected installation grants core read permissions. */
4344
- corePermissionsOk: boolean;
4345
- /** @description True when every connected installation grants write permissions for automated fixes. */
4346
- writePermissionsOk: boolean;
4347
- /** @description True when any connected installation lacks write permissions for automated fixes. */
4348
- writePermissionsUpgradeRequired: boolean;
4349
- /** @description Aggregated write permissions missing on installations that lack write access. */
4350
- missingWritePermissions?: components["schemas"]["GithubMissingPermissionDto"][];
4351
- /** @description Human-readable summary when write permissions are missing. */
4352
- writeUpgradeMessage?: string | null;
4353
4436
  /** @description Present when an org admin must approve the GitHub App install request. */
4354
4437
  pendingApproval?: components["schemas"]["GithubPendingApprovalDto"] | null;
4355
4438
  /** @description Present when GitHub connect was started but not completed (install OAuth state or account-picker session still active). Omitted when pendingApproval is set. */
@@ -5756,6 +5839,8 @@ export type CursorSourceConfigDto = components['schemas']['CursorSourceConfigDto
5756
5839
  export type ClaudeSourceDto = components['schemas']['ClaudeSourceDto'];
5757
5840
  export type ClaudeSourcePatchDto = components['schemas']['ClaudeSourcePatchDto'];
5758
5841
  export type ClaudeSourceConfigDto = components['schemas']['ClaudeSourceConfigDto'];
5842
+ export type NewRelicSourceDto = components['schemas']['NewRelicSourceDto'];
5843
+ export type NewRelicSourceConfigDto = components['schemas']['NewRelicSourceConfigDto'];
5759
5844
  export type AgentExecutionProviderDto = components['schemas']['AgentExecutionProviderDto'];
5760
5845
  export type WorkspaceConfigDto = components['schemas']['WorkspaceConfigDto'];
5761
5846
  export type TestConnectionResponseDto = components['schemas']['TestConnectionResponseDto'];
@@ -5871,13 +5956,13 @@ export type RepoEligibilityOverridesDto = components['schemas']['RepoEligibility
5871
5956
  export type WorkspaceRepoEligibilityDto = components['schemas']['WorkspaceRepoEligibilityDto'];
5872
5957
  export type RepoEligibilityLimitsDto = components['schemas']['RepoEligibilityLimitsDto'];
5873
5958
  export type GithubMissingPermissionDto = components['schemas']['GithubMissingPermissionDto'];
5874
- export type GithubWritePermissionsRequiredErrorDto = components['schemas']['GithubWritePermissionsRequiredErrorDto'];
5875
- export type GithubPermissionsCheckFailedErrorDto = components['schemas']['GithubPermissionsCheckFailedErrorDto'];
5876
5959
  export type GithubInstallationSummaryDto = components['schemas']['GithubInstallationSummaryDto'];
5877
5960
  export type GithubPendingApprovalDto = components['schemas']['GithubPendingApprovalDto'];
5878
5961
  export type GithubSetupInProgressDto = components['schemas']['GithubSetupInProgressDto'];
5879
5962
  export type GithubActionsWorkflowPreviewDto = components['schemas']['GithubActionsWorkflowPreviewDto'];
5880
5963
  export type GithubActionsIntegrationStatusDto = components['schemas']['GithubActionsIntegrationStatusDto'];
5964
+ export type NewRelicIntegrationStatusDto = components['schemas']['NewRelicIntegrationStatusDto'];
5965
+ export type NewRelicTriggerSyncResultDto = components['schemas']['NewRelicTriggerSyncResultDto'];
5881
5966
  export type GithubActionsEnableResponseDto = components['schemas']['GithubActionsEnableResponseDto'];
5882
5967
  export type GithubInstallationStatusDto = components['schemas']['GithubInstallationStatusDto'];
5883
5968
  export type GithubInstallUrlRequestDto = components['schemas']['GithubInstallUrlRequestDto'];
@@ -7401,7 +7486,7 @@ export interface operations {
7401
7486
  requestBody: {
7402
7487
  content: {
7403
7488
  "application/json": {
7404
- sources: (components["schemas"]["CursorSourcePatchDto"] | components["schemas"]["CursorSourceDto"] | components["schemas"]["ClaudeSourcePatchDto"] | components["schemas"]["ClaudeSourceDto"] | components["schemas"]["TenantSourceEntryDto"])[];
7489
+ sources: (components["schemas"]["CursorSourcePatchDto"] | components["schemas"]["CursorSourceDto"] | components["schemas"]["ClaudeSourcePatchDto"] | components["schemas"]["ClaudeSourceDto"] | components["schemas"]["NewRelicSourceDto"] | components["schemas"]["TenantSourceEntryDto"])[];
7405
7490
  };
7406
7491
  };
7407
7492
  };
@@ -7455,7 +7540,7 @@ export interface operations {
7455
7540
  };
7456
7541
  requestBody: {
7457
7542
  content: {
7458
- "application/json": components["schemas"]["CursorSourcePatchDto"] | components["schemas"]["CursorSourceDto"] | components["schemas"]["ClaudeSourcePatchDto"] | components["schemas"]["ClaudeSourceDto"] | components["schemas"]["TenantSourceEntryDto"];
7543
+ "application/json": components["schemas"]["CursorSourcePatchDto"] | components["schemas"]["CursorSourceDto"] | components["schemas"]["ClaudeSourcePatchDto"] | components["schemas"]["ClaudeSourceDto"] | components["schemas"]["NewRelicSourceDto"] | components["schemas"]["TenantSourceEntryDto"];
7459
7544
  };
7460
7545
  };
7461
7546
  responses: {
@@ -9681,6 +9766,90 @@ export interface operations {
9681
9766
  };
9682
9767
  };
9683
9768
  };
9769
+ getWorkspaceNewRelicIntegrationStatus: {
9770
+ parameters: {
9771
+ query?: never;
9772
+ header?: never;
9773
+ path: {
9774
+ workspaceId: components["parameters"]["WorkspaceId"];
9775
+ };
9776
+ cookie?: never;
9777
+ };
9778
+ requestBody?: never;
9779
+ responses: {
9780
+ /** @description New Relic integration status */
9781
+ 200: {
9782
+ headers: {
9783
+ [name: string]: unknown;
9784
+ };
9785
+ content: {
9786
+ "application/json": components["schemas"]["NewRelicIntegrationStatusDto"];
9787
+ };
9788
+ };
9789
+ 401: components["responses"]["Unauthorized"];
9790
+ 403: components["responses"]["Forbidden"];
9791
+ /** @description Workspace does not exist or malformed workspaceId */
9792
+ 404: {
9793
+ headers: {
9794
+ [name: string]: unknown;
9795
+ };
9796
+ content: {
9797
+ "application/json": components["schemas"]["ErrorMessageDto"];
9798
+ };
9799
+ };
9800
+ };
9801
+ };
9802
+ postWorkspaceNewRelicIntegrationSync: {
9803
+ parameters: {
9804
+ query?: never;
9805
+ header?: never;
9806
+ path: {
9807
+ workspaceId: components["parameters"]["WorkspaceId"];
9808
+ };
9809
+ cookie?: never;
9810
+ };
9811
+ requestBody?: never;
9812
+ responses: {
9813
+ /** @description Sync completed */
9814
+ 200: {
9815
+ headers: {
9816
+ [name: string]: unknown;
9817
+ };
9818
+ content: {
9819
+ "application/json": components["schemas"]["NewRelicTriggerSyncResultDto"];
9820
+ };
9821
+ };
9822
+ 401: components["responses"]["Unauthorized"];
9823
+ 403: components["responses"]["Forbidden"];
9824
+ /** @description Workspace does not exist or malformed workspaceId */
9825
+ 404: {
9826
+ headers: {
9827
+ [name: string]: unknown;
9828
+ };
9829
+ content: {
9830
+ "application/json": components["schemas"]["ErrorMessageDto"];
9831
+ };
9832
+ };
9833
+ /** @description New Relic is not connected on this workspace */
9834
+ 422: {
9835
+ headers: {
9836
+ [name: string]: unknown;
9837
+ };
9838
+ content: {
9839
+ "application/json": components["schemas"]["NewRelicTriggerSyncResultDto"];
9840
+ };
9841
+ };
9842
+ /** @description Sync failed (NerdGraph or persistence error) */
9843
+ 503: {
9844
+ headers: {
9845
+ [name: string]: unknown;
9846
+ };
9847
+ content: {
9848
+ "application/json": components["schemas"]["NewRelicTriggerSyncResultDto"];
9849
+ };
9850
+ };
9851
+ };
9852
+ };
9684
9853
  postGithubWebhook: {
9685
9854
  parameters: {
9686
9855
  query?: never;
@@ -11384,24 +11553,6 @@ export interface operations {
11384
11553
  "application/json": components["schemas"]["ErrorMessageDto"];
11385
11554
  };
11386
11555
  };
11387
- /** @description GitHub installation lacks write permissions required for automated fix PRs */
11388
- 422: {
11389
- headers: {
11390
- [name: string]: unknown;
11391
- };
11392
- content: {
11393
- "application/json": components["schemas"]["GithubWritePermissionsRequiredErrorDto"];
11394
- };
11395
- };
11396
- /** @description GitHub installation permissions could not be verified */
11397
- 503: {
11398
- headers: {
11399
- [name: string]: unknown;
11400
- };
11401
- content: {
11402
- "application/json": components["schemas"]["GithubPermissionsCheckFailedErrorDto"];
11403
- };
11404
- };
11405
11556
  };
11406
11557
  };
11407
11558
  postReadinessFixRetrigger: {
@@ -11445,24 +11596,6 @@ export interface operations {
11445
11596
  "application/json": components["schemas"]["ErrorMessageDto"];
11446
11597
  };
11447
11598
  };
11448
- /** @description GitHub installation lacks write permissions required for automated fix PRs */
11449
- 422: {
11450
- headers: {
11451
- [name: string]: unknown;
11452
- };
11453
- content: {
11454
- "application/json": components["schemas"]["GithubWritePermissionsRequiredErrorDto"];
11455
- };
11456
- };
11457
- /** @description GitHub installation permissions could not be verified */
11458
- 503: {
11459
- headers: {
11460
- [name: string]: unknown;
11461
- };
11462
- content: {
11463
- "application/json": components["schemas"]["GithubPermissionsCheckFailedErrorDto"];
11464
- };
11465
- };
11466
11599
  };
11467
11600
  };
11468
11601
  putCursorPlatformKeyConsent: {