@thinkai/tai-api-contract 2.94.0 → 2.96.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.
@@ -595,7 +595,7 @@ export interface paths {
595
595
  /**
596
596
  * Test one source connection (does not persist)
597
597
  * @description Verify a source's credentials without persisting them. Always returns 200 — upstream auth, rate-limit, and network failures surface as `{ success: false, error }` so the SPA can render an inline error.
598
- * Registered AI tools are verified end-to-end: `cursor` (Admin API key in `token` and/or execution key in `executionToken`; at least one must be present). Execution-only tests validate the key against the Cloud Agents API (`GET /v1/me`, with `GET /v1/models` fallback for service accounts) and return `executionKeyValid` / `executionKeyError` without calling the Admin API on `token`. Malformed cursor entries return `400` with `code: invalid_source_entry`. `claude` (Anthropic Admin API at `https://api.anthropic.com`, `X-Api-Key` with an organization Admin API key `sk-ant-admin...`). `sonarqube` (`baseUrl`, `token`, `projectKey` required; optional `branch`) calls `GET {baseUrl}/api/measures/component` with a Bearer token. Other types report `{ success: false, error: "unsupported_type" }`. Documented `error` codes for AI tool verifiers: `invalid_token`, `rate_limited`, `network_error`.
598
+ * Registered AI tools are verified end-to-end: `cursor` (Admin API key in `token` and/or execution key in `executionToken`; at least one must be present). Execution-only tests validate the key against the Cloud Agents API (`GET /v1/me`, with `GET /v1/models` fallback for service accounts) and return `executionKeyValid` / `executionKeyError` without calling the Admin API on `token`. Malformed cursor entries return `400` with `code: invalid_source_entry`. `claude` (Anthropic Admin API at `https://api.anthropic.com`, `X-Api-Key` with an organization Admin API key `sk-ant-admin...`). `sonarqube` (`baseUrl`, `token`, `projectKey` required; optional `branch`) calls `GET {baseUrl}/api/measures/component` with a Bearer token. Other types report `{ success: false, error: "unsupported_type" }`. Documented `error` codes for AI tool verifiers: `invalid_token`, `rate_limited`, `network_error`. `jira` (`baseUrl`, `email`, `apiToken` or legacy `api_key`) calls `GET {baseUrl}/rest/api/3/myself` with Basic auth.
599
599
  * **Typical outcomes:** Malformed body, missing `type`, invalid `type`, or missing required fields for the declared type → `400` with `{ error: "..." }`. Well-formed body with bad credentials or unreachable service → `200` with `{ success: false, error: "..." }`.
600
600
  */
601
601
  post: operations["postTenantSourceTest"];
@@ -605,6 +605,44 @@ export interface paths {
605
605
  patch?: never;
606
606
  trace?: never;
607
607
  };
608
+ "/workspaces/{workspaceId}/integrations/sonarqube/repo-mappings": {
609
+ parameters: {
610
+ query?: never;
611
+ header?: never;
612
+ path?: never;
613
+ cookie?: never;
614
+ };
615
+ /** List SonarQube repo to project key mappings */
616
+ get: operations["listSonarQubeRepoMappings"];
617
+ /**
618
+ * Replace SonarQube repo mappings (full list)
619
+ * @description Replaces all SonarQube repo→projectKey rows for the workspace. Validate rows in the UI before save; optional `POST .../validate` probes keys with the workspace token.
620
+ */
621
+ put: operations["putSonarQubeRepoMappings"];
622
+ post?: never;
623
+ delete?: never;
624
+ options?: never;
625
+ head?: never;
626
+ patch?: never;
627
+ trace?: never;
628
+ };
629
+ "/workspaces/{workspaceId}/integrations/sonarqube/repo-mappings/validate": {
630
+ parameters: {
631
+ query?: never;
632
+ header?: never;
633
+ path?: never;
634
+ cookie?: never;
635
+ };
636
+ get?: never;
637
+ put?: never;
638
+ /** Validate SonarQube mapping rows against the workspace token */
639
+ post: operations["validateSonarQubeRepoMappings"];
640
+ delete?: never;
641
+ options?: never;
642
+ head?: never;
643
+ patch?: never;
644
+ trace?: never;
645
+ };
608
646
  "/workspaces/{workspaceId}/sources/{type}": {
609
647
  parameters: {
610
648
  query?: never;
@@ -2132,8 +2170,8 @@ export interface paths {
2132
2170
  /**
2133
2171
  * Export repository readiness issues as Markdown
2134
2172
  * @description Download outstanding readiness issues for one repository as a Markdown (`.md`) attachment for local IDE workflows. Reuses the same scorecard as `GET .../readiness/repos/{repoId}` (issues plus optional remediation from `criteriaDetails`).
2135
- * The Markdown is grouped **by readiness dimension** (catalog order). Each dimension section lists matching issues sorted by severity. Issue sections include severity in the heading and do not emit per-issue `Fix status` / `Fix tier` lines. Default filter is outstanding issues (`open` + `pr-pending`). Optional query params narrow the set. When `includeCriteria` is true (default), each issue includes a Remediation section from the matching criterion when available. Timestamps use the optional `timeZone` query (IANA; default `UTC`).
2136
- * The response sets `Content-Disposition: attachment` with filename `readiness-issues-{providerSlug}-{date}.md`.
2173
+ * The Markdown is grouped **by readiness dimension** (catalog order). Each dimension section lists matching issues sorted by severity. Issue sections include severity in the heading, export format version, issue/rubric metadata, agent workflow, and agent instructions from the rubric when available. Default filter is outstanding issues (`open` + `pr-pending`). Optional query params narrow the set. When `includeCriteria` is true (default), each issue also includes criterion summary/status in metadata and remediation from `criteriaDetails` when it differs from agent instructions. Agent workflow and rubric agent instructions are emitted regardless of `includeCriteria`. Timestamps use the optional `timeZone` query (IANA; default `UTC`).
2174
+ * The response sets `Content-Disposition: attachment` with filename `readiness-remediations-{providerSlug}-{date}.md`.
2137
2175
  */
2138
2176
  get: operations["exportReadinessRepoIssuesMarkdown"];
2139
2177
  put?: never;
@@ -3990,17 +4028,17 @@ export interface components {
3990
4028
  orgId?: string;
3991
4029
  orgName?: string;
3992
4030
  };
3993
- /** @description SonarQube source for workspace sources PUT and connection test. Every field is re-submitted on each save; `token` is never round-tripped from `GET` workspace config. */
4031
+ /** @description SonarQube source for workspace sources PUT and connection test. Credentials only — per-repository Sonar project keys are configured via repo mappings. Every field is re-submitted on each save; `token` is never round-tripped from `GET` workspace config. */
3994
4032
  SonarQubeSourceDto: {
3995
4033
  /** @enum {string} */
3996
4034
  type: "sonarqube";
3997
- /** @description SonarQube server URL, e.g. https://sonarqube.example.com. */
4035
+ /** @description SonarQube server URL, e.g. https://sonarcloud.io or https://sonarqube.example.com. */
3998
4036
  baseUrl: string;
3999
- /** @description User or project analysis token (write-only on PUT). Literal tokens are encrypted at rest. Operator-managed secrets may use an `env:VAR` reference (resolved at runtime / batch poll), matching other non-AI-tool sources. */
4037
+ /** @description User or project analysis token (write-only on PUT). Literal tokens are encrypted at rest. Operator-managed secrets may use an `env:VAR` reference (resolved at runtime), matching other non-AI-tool sources. */
4000
4038
  token: string;
4001
- /** @description SonarQube project key (component key). */
4002
- projectKey: string;
4003
- /** @description Optional branch name for branch-scoped measures. */
4039
+ /** @description SonarCloud organization key (required for project search on SonarCloud). */
4040
+ organization?: string;
4041
+ /** @description Optional workspace default branch fallback for per-repo Sonar probes. */
4004
4042
  branch?: string;
4005
4043
  };
4006
4044
  /** @description Redacted SonarQube source returned by GET workspace config. */
@@ -4009,8 +4047,37 @@ export interface components {
4009
4047
  type: "sonarqube";
4010
4048
  hasToken: boolean;
4011
4049
  baseUrl: string;
4050
+ organization?: string;
4051
+ branch?: string;
4052
+ };
4053
+ SonarQubeRepoMappingDto: {
4054
+ /** @description Repository slug (`owner/repo`) in the workspace catalog. */
4055
+ providerSlug: string;
4056
+ projectKey: string;
4057
+ /** @description Optional branch override for Sonar API calls for this repo. */
4058
+ branch?: string;
4059
+ };
4060
+ SonarQubeRepoMappingRowDto: components["schemas"]["SonarQubeRepoMappingDto"] & {
4061
+ /** Format: uuid */
4062
+ repoId: string;
4063
+ /** Format: date-time */
4064
+ updatedAt: string;
4065
+ };
4066
+ SonarQubeRepoMappingsPutDto: {
4067
+ mappings: components["schemas"]["SonarQubeRepoMappingDto"][];
4068
+ };
4069
+ SonarQubeRepoMappingsListDto: {
4070
+ mappings: components["schemas"]["SonarQubeRepoMappingRowDto"][];
4071
+ };
4072
+ SonarQubeRepoMappingValidateRowDto: {
4073
+ providerSlug: string;
4012
4074
  projectKey: string;
4013
4075
  branch?: string;
4076
+ ok: boolean;
4077
+ error?: string;
4078
+ };
4079
+ SonarQubeRepoMappingsValidateResponseDto: {
4080
+ results: components["schemas"]["SonarQubeRepoMappingValidateRowDto"][];
4014
4081
  };
4015
4082
  /** @description PagerDuty incident monitoring source for `PUT /workspaces/{workspaceId}/sources` and `POST /workspaces/{workspaceId}/sources/test`. Requires a REST API v2 token (an "API Access Key" from PagerDuty → **Integrations → API Access Keys**). */
4016
4083
  PagerDutySourceDto: {
@@ -4038,6 +4105,38 @@ export interface components {
4038
4105
  /** @description PagerDuty user email when known from the last successful verify. */
4039
4106
  userEmail?: string;
4040
4107
  };
4108
+ /** @description Jira Cloud source for `PUT /workspaces/{workspaceId}/sources` and `POST /workspaces/{workspaceId}/sources/test`. Uses Atlassian Cloud email + API token (Basic auth). Provide `apiToken` (preferred) or legacy write-only `api_key`; the server normalizes `api_key` to `apiToken` on write. */
4109
+ JiraSourceDto: {
4110
+ /** @enum {string} */
4111
+ type: "jira";
4112
+ /** @description Jira Cloud site URL (e.g. `https://your-domain.atlassian.net`). */
4113
+ baseUrl: string;
4114
+ /** @description Atlassian account email used with the API token. */
4115
+ email: string;
4116
+ /** @description Atlassian API token (write-only on PUT; preferred). */
4117
+ apiToken?: string;
4118
+ /** @description Deprecated write-only alias for `apiToken`. Accepted for backward compatibility; normalized to `apiToken` and never returned on GET `/config`. */
4119
+ api_key?: string;
4120
+ /** @description Optional display name from a successful connection test (echo-after-test). */
4121
+ userName?: string;
4122
+ /** @description Optional Atlassian account id from a successful connection test. */
4123
+ accountId?: string;
4124
+ };
4125
+ /** @description Redacted Jira source returned by `GET /workspaces/{workspaceId}/config`. Raw API token is never returned. */
4126
+ JiraSourceConfigDto: {
4127
+ /** @enum {string} */
4128
+ type: "jira";
4129
+ /** @description Whether an API token is stored for this workspace. */
4130
+ hasToken: boolean;
4131
+ /** @description Configured Jira Cloud site URL. */
4132
+ baseUrl: string;
4133
+ /** @description Atlassian account email associated with the stored token. */
4134
+ email: string;
4135
+ /** @description Display name when known from the last successful verify. */
4136
+ userName?: string;
4137
+ /** @description Atlassian account id when known from the last successful verify. */
4138
+ accountId?: string;
4139
+ };
4041
4140
  /**
4042
4141
  * @description The agent execution account used for Agentic Foundation runs (readiness scanner + fix queue). Exactly one is active per workspace.
4043
4142
  * - `thinkai_platform_cursor`: ThinkAI platform Cursor key (Cursor Agent CLI) — opt-in, never default.
@@ -4056,7 +4155,7 @@ export interface components {
4056
4155
  claudeModel?: string | null;
4057
4156
  };
4058
4157
  WorkspaceConfigDto: {
4059
- sources: (components["schemas"]["CursorSourceConfigDto"] | components["schemas"]["ClaudeSourceConfigDto"] | components["schemas"]["CodeIntelligenceSourceConfigDto"] | components["schemas"]["NewRelicSourceConfigDto"] | components["schemas"]["PrometheusSourceConfigDto"] | components["schemas"]["GrafanaSourceConfigDto"] | components["schemas"]["SonarQubeSourceConfigDto"] | components["schemas"]["PagerDutySourceConfigDto"] | components["schemas"]["TenantSourceEntryDto"])[];
4158
+ sources: (components["schemas"]["CursorSourceConfigDto"] | components["schemas"]["ClaudeSourceConfigDto"] | components["schemas"]["CodeIntelligenceSourceConfigDto"] | components["schemas"]["NewRelicSourceConfigDto"] | components["schemas"]["PrometheusSourceConfigDto"] | components["schemas"]["GrafanaSourceConfigDto"] | components["schemas"]["SonarQubeSourceConfigDto"] | components["schemas"]["PagerDutySourceConfigDto"] | components["schemas"]["JiraSourceConfigDto"] | components["schemas"]["TenantSourceEntryDto"])[];
4060
4159
  orgChart?: components["schemas"]["ScoringOrgChartDto"] | null;
4061
4160
  /** @enum {string|null} */
4062
4161
  region?: "us" | "eu" | "me" | null;
@@ -4091,11 +4190,11 @@ export interface components {
4091
4190
  executionKeyValid?: boolean | null;
4092
4191
  /** @description Error detail when `executionKeyValid` is false. */
4093
4192
  executionKeyError?: string | null;
4094
- /** @description Present for New Relic or Grafana verify success — authenticated user name. */
4193
+ /** @description Present for New Relic, Grafana, PagerDuty, or Jira verify success — authenticated user name. */
4095
4194
  userName?: string;
4096
4195
  /** @description Present for New Relic verify success — resolved account display name. */
4097
4196
  accountName?: string;
4098
- /** @description Present for New Relic verify success — resolved account ID. */
4197
+ /** @description Present for New Relic or Jira verify success — resolved account ID. */
4099
4198
  accountId?: string;
4100
4199
  /** @description Present for Grafana verify success — resolved organization name. */
4101
4200
  orgName?: string;
@@ -8178,8 +8277,16 @@ export type GrafanaSourceDto = components['schemas']['GrafanaSourceDto'];
8178
8277
  export type GrafanaSourceConfigDto = components['schemas']['GrafanaSourceConfigDto'];
8179
8278
  export type SonarQubeSourceDto = components['schemas']['SonarQubeSourceDto'];
8180
8279
  export type SonarQubeSourceConfigDto = components['schemas']['SonarQubeSourceConfigDto'];
8280
+ export type SonarQubeRepoMappingDto = components['schemas']['SonarQubeRepoMappingDto'];
8281
+ export type SonarQubeRepoMappingRowDto = components['schemas']['SonarQubeRepoMappingRowDto'];
8282
+ export type SonarQubeRepoMappingsPutDto = components['schemas']['SonarQubeRepoMappingsPutDto'];
8283
+ export type SonarQubeRepoMappingsListDto = components['schemas']['SonarQubeRepoMappingsListDto'];
8284
+ export type SonarQubeRepoMappingValidateRowDto = components['schemas']['SonarQubeRepoMappingValidateRowDto'];
8285
+ export type SonarQubeRepoMappingsValidateResponseDto = components['schemas']['SonarQubeRepoMappingsValidateResponseDto'];
8181
8286
  export type PagerDutySourceDto = components['schemas']['PagerDutySourceDto'];
8182
8287
  export type PagerDutySourceConfigDto = components['schemas']['PagerDutySourceConfigDto'];
8288
+ export type JiraSourceDto = components['schemas']['JiraSourceDto'];
8289
+ export type JiraSourceConfigDto = components['schemas']['JiraSourceConfigDto'];
8183
8290
  export type AgentExecutionProviderDto = components['schemas']['AgentExecutionProviderDto'];
8184
8291
  export type PutCodeIntelligenceSettingsDto = components['schemas']['PutCodeIntelligenceSettingsDto'];
8185
8292
  export type WorkspaceConfigDto = components['schemas']['WorkspaceConfigDto'];
@@ -10146,7 +10253,7 @@ export interface operations {
10146
10253
  requestBody: {
10147
10254
  content: {
10148
10255
  "application/json": {
10149
- sources: (components["schemas"]["CursorSourcePatchDto"] | components["schemas"]["CursorSourceDto"] | components["schemas"]["ClaudeSourcePatchDto"] | components["schemas"]["ClaudeSourceDto"] | components["schemas"]["CodeIntelligenceSourcePatchDto"] | components["schemas"]["NewRelicSourceDto"] | components["schemas"]["PrometheusSourceDto"] | components["schemas"]["GrafanaSourceDto"] | components["schemas"]["SonarQubeSourceDto"] | components["schemas"]["PagerDutySourceDto"] | components["schemas"]["TenantSourceEntryDto"])[];
10256
+ sources: (components["schemas"]["CursorSourcePatchDto"] | components["schemas"]["CursorSourceDto"] | components["schemas"]["ClaudeSourcePatchDto"] | components["schemas"]["ClaudeSourceDto"] | components["schemas"]["CodeIntelligenceSourcePatchDto"] | components["schemas"]["NewRelicSourceDto"] | components["schemas"]["PrometheusSourceDto"] | components["schemas"]["GrafanaSourceDto"] | components["schemas"]["SonarQubeSourceDto"] | components["schemas"]["PagerDutySourceDto"] | components["schemas"]["JiraSourceDto"] | components["schemas"]["TenantSourceEntryDto"])[];
10150
10257
  };
10151
10258
  };
10152
10259
  };
@@ -10200,7 +10307,7 @@ export interface operations {
10200
10307
  };
10201
10308
  requestBody: {
10202
10309
  content: {
10203
- "application/json": components["schemas"]["CursorSourcePatchDto"] | components["schemas"]["CursorSourceDto"] | components["schemas"]["ClaudeSourcePatchDto"] | components["schemas"]["ClaudeSourceDto"] | components["schemas"]["CodeIntelligenceSourcePatchDto"] | components["schemas"]["NewRelicSourceDto"] | components["schemas"]["PrometheusSourceDto"] | components["schemas"]["GrafanaSourceDto"] | components["schemas"]["SonarQubeSourceDto"] | components["schemas"]["PagerDutySourceDto"] | components["schemas"]["TenantSourceEntryDto"];
10310
+ "application/json": components["schemas"]["CursorSourcePatchDto"] | components["schemas"]["CursorSourceDto"] | components["schemas"]["ClaudeSourcePatchDto"] | components["schemas"]["ClaudeSourceDto"] | components["schemas"]["CodeIntelligenceSourcePatchDto"] | components["schemas"]["NewRelicSourceDto"] | components["schemas"]["PrometheusSourceDto"] | components["schemas"]["GrafanaSourceDto"] | components["schemas"]["SonarQubeSourceDto"] | components["schemas"]["PagerDutySourceDto"] | components["schemas"]["JiraSourceDto"] | components["schemas"]["TenantSourceEntryDto"];
10204
10311
  };
10205
10312
  };
10206
10313
  responses: {
@@ -10238,6 +10345,100 @@ export interface operations {
10238
10345
  };
10239
10346
  };
10240
10347
  };
10348
+ listSonarQubeRepoMappings: {
10349
+ parameters: {
10350
+ query?: never;
10351
+ header?: never;
10352
+ path: {
10353
+ workspaceId: components["parameters"]["WorkspaceId"];
10354
+ };
10355
+ cookie?: never;
10356
+ };
10357
+ requestBody?: never;
10358
+ responses: {
10359
+ /** @description Mappings for repos in this workspace */
10360
+ 200: {
10361
+ headers: {
10362
+ [name: string]: unknown;
10363
+ };
10364
+ content: {
10365
+ "application/json": components["schemas"]["SonarQubeRepoMappingsListDto"];
10366
+ };
10367
+ };
10368
+ 401: components["responses"]["Unauthorized"];
10369
+ 403: components["responses"]["Forbidden"];
10370
+ };
10371
+ };
10372
+ putSonarQubeRepoMappings: {
10373
+ parameters: {
10374
+ query?: never;
10375
+ header?: never;
10376
+ path: {
10377
+ workspaceId: components["parameters"]["WorkspaceId"];
10378
+ };
10379
+ cookie?: never;
10380
+ };
10381
+ requestBody: {
10382
+ content: {
10383
+ "application/json": components["schemas"]["SonarQubeRepoMappingsPutDto"];
10384
+ };
10385
+ };
10386
+ responses: {
10387
+ /** @description Mappings saved */
10388
+ 200: {
10389
+ headers: {
10390
+ [name: string]: unknown;
10391
+ };
10392
+ content: {
10393
+ "application/json": components["schemas"]["SonarQubeRepoMappingsListDto"];
10394
+ };
10395
+ };
10396
+ /** @description Unknown repo slug or invalid body */
10397
+ 400: {
10398
+ headers: {
10399
+ [name: string]: unknown;
10400
+ };
10401
+ content?: never;
10402
+ };
10403
+ 401: components["responses"]["Unauthorized"];
10404
+ 403: components["responses"]["Forbidden"];
10405
+ };
10406
+ };
10407
+ validateSonarQubeRepoMappings: {
10408
+ parameters: {
10409
+ query?: never;
10410
+ header?: never;
10411
+ path: {
10412
+ workspaceId: components["parameters"]["WorkspaceId"];
10413
+ };
10414
+ cookie?: never;
10415
+ };
10416
+ requestBody: {
10417
+ content: {
10418
+ "application/json": components["schemas"]["SonarQubeRepoMappingsPutDto"];
10419
+ };
10420
+ };
10421
+ responses: {
10422
+ /** @description Per-row probe results */
10423
+ 200: {
10424
+ headers: {
10425
+ [name: string]: unknown;
10426
+ };
10427
+ content: {
10428
+ "application/json": components["schemas"]["SonarQubeRepoMappingsValidateResponseDto"];
10429
+ };
10430
+ };
10431
+ 401: components["responses"]["Unauthorized"];
10432
+ 403: components["responses"]["Forbidden"];
10433
+ /** @description SonarQube source not configured */
10434
+ 503: {
10435
+ headers: {
10436
+ [name: string]: unknown;
10437
+ };
10438
+ content?: never;
10439
+ };
10440
+ };
10441
+ };
10241
10442
  deleteSourceByType: {
10242
10443
  parameters: {
10243
10444
  query?: never;
@@ -14125,7 +14326,7 @@ export interface operations {
14125
14326
  fixStatus?: "open" | "pr-pending" | "fixed";
14126
14327
  dimensionId?: components["schemas"]["ReadinessDimensionId"];
14127
14328
  severity?: "critical" | "high" | "medium" | "low";
14128
- /** @description Include remediation from criteriaDetails (default true). */
14329
+ /** @description When true (default), include criterion summary/status in issue metadata and remediation from `criteriaDetails` (plus inline scan remediation paragraphs). Agent workflow and rubric agent instructions are always included. When false, omit criterion-derived metadata and criterion remediation only. */
14129
14330
  includeCriteria?: boolean;
14130
14331
  /** @description IANA time zone for human-readable `Last analyzed` / `Exported` timestamps and the calendar date in the attachment filename (e.g. `Europe/Berlin`). Defaults to `UTC`. */
14131
14332
  timeZone?: string;