@thinkai/tai-api-contract 2.95.0 → 2.97.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.
@@ -560,6 +560,27 @@ export interface paths {
560
560
  patch?: never;
561
561
  trace?: never;
562
562
  };
563
+ "/workspaces/{workspaceId}/delivery-topology": {
564
+ parameters: {
565
+ query?: never;
566
+ header?: never;
567
+ path?: never;
568
+ cookie?: never;
569
+ };
570
+ get?: never;
571
+ /**
572
+ * Set workspace delivery topology
573
+ * @description Persist the workspace delivery topology used by federated readiness assessment: which connected repos hold terraform / gitops / ci_templates / api_contracts artifacts, plus optional per-service overrides. Role and override `providerSlug` values must reference repos connected to this workspace, otherwise the request is rejected with `400 invalid_delivery_topology`. Send `null` (or `{ "deliveryTopology": null }`) to clear the topology.
574
+ * Requires editor or admin workspace role.
575
+ */
576
+ put: operations["putWorkspaceDeliveryTopology"];
577
+ post?: never;
578
+ delete?: never;
579
+ options?: never;
580
+ head?: never;
581
+ patch?: never;
582
+ trace?: never;
583
+ };
563
584
  "/workspaces/{workspaceId}/sources": {
564
585
  parameters: {
565
586
  query?: never;
@@ -595,7 +616,7 @@ export interface paths {
595
616
  /**
596
617
  * Test one source connection (does not persist)
597
618
  * @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`.
619
+ * 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
620
  * **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
621
  */
601
622
  post: operations["postTenantSourceTest"];
@@ -4105,6 +4126,38 @@ export interface components {
4105
4126
  /** @description PagerDuty user email when known from the last successful verify. */
4106
4127
  userEmail?: string;
4107
4128
  };
4129
+ /** @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. */
4130
+ JiraSourceDto: {
4131
+ /** @enum {string} */
4132
+ type: "jira";
4133
+ /** @description Jira Cloud site URL (e.g. `https://your-domain.atlassian.net`). */
4134
+ baseUrl: string;
4135
+ /** @description Atlassian account email used with the API token. */
4136
+ email: string;
4137
+ /** @description Atlassian API token (write-only on PUT; preferred). */
4138
+ apiToken?: string;
4139
+ /** @description Deprecated write-only alias for `apiToken`. Accepted for backward compatibility; normalized to `apiToken` and never returned on GET `/config`. */
4140
+ api_key?: string;
4141
+ /** @description Optional display name from a successful connection test (echo-after-test). */
4142
+ userName?: string;
4143
+ /** @description Optional Atlassian account id from a successful connection test. */
4144
+ accountId?: string;
4145
+ };
4146
+ /** @description Redacted Jira source returned by `GET /workspaces/{workspaceId}/config`. Raw API token is never returned. */
4147
+ JiraSourceConfigDto: {
4148
+ /** @enum {string} */
4149
+ type: "jira";
4150
+ /** @description Whether an API token is stored for this workspace. */
4151
+ hasToken: boolean;
4152
+ /** @description Configured Jira Cloud site URL. */
4153
+ baseUrl: string;
4154
+ /** @description Atlassian account email associated with the stored token. */
4155
+ email: string;
4156
+ /** @description Display name when known from the last successful verify. */
4157
+ userName?: string;
4158
+ /** @description Atlassian account id when known from the last successful verify. */
4159
+ accountId?: string;
4160
+ };
4108
4161
  /**
4109
4162
  * @description The agent execution account used for Agentic Foundation runs (readiness scanner + fix queue). Exactly one is active per workspace.
4110
4163
  * - `thinkai_platform_cursor`: ThinkAI platform Cursor key (Cursor Agent CLI) — opt-in, never default.
@@ -4123,7 +4176,7 @@ export interface components {
4123
4176
  claudeModel?: string | null;
4124
4177
  };
4125
4178
  WorkspaceConfigDto: {
4126
- 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"])[];
4179
+ 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"])[];
4127
4180
  orgChart?: components["schemas"]["ScoringOrgChartDto"] | null;
4128
4181
  /** @enum {string|null} */
4129
4182
  region?: "us" | "eu" | "me" | null;
@@ -4149,6 +4202,52 @@ export interface components {
4149
4202
  codeIntelligenceClaudeModel?: string | null;
4150
4203
  /** @description True when a dedicated `code_intelligence` source has a stored executionToken. */
4151
4204
  hasCodeIntelligenceExecutionToken?: boolean;
4205
+ /** @description Federated-readiness delivery topology: which connected repos hold terraform / gitops / ci_templates / api_contracts truth for this workspace. Null when not configured. Change via `PUT /workspaces/{workspaceId}/delivery-topology`. */
4206
+ deliveryTopology?: components["schemas"]["DeliveryTopologyDto"] | null;
4207
+ };
4208
+ DeliveryRoleConfigDto: {
4209
+ /** @description Connected workspace repo (`owner/repo`) that holds this role's artifacts. */
4210
+ providerSlug: string;
4211
+ /**
4212
+ * @description IaC engine hint (terraform role only).
4213
+ * @enum {string}
4214
+ */
4215
+ engine?: "terraform" | "pulumi" | "cdk";
4216
+ /**
4217
+ * @description CI templates flavor (ci_templates role only).
4218
+ * @enum {string}
4219
+ */
4220
+ type?: "reusable_workflows";
4221
+ /** @description Set true for extension roles outside the known role keys. */
4222
+ custom?: boolean;
4223
+ };
4224
+ RepoDeliveryOverrideDto: {
4225
+ /** @enum {string} */
4226
+ deliveryModel?: "auto" | "k8s_microservices" | "mobile_store" | "web_hosting" | "data_pipelines" | "monorepo" | "library" | "hybrid";
4227
+ /** @description Per-service role → providerSlug overrides (merged over workspace roles). */
4228
+ roles?: {
4229
+ [key: string]: string;
4230
+ };
4231
+ /** @description Path prefix inside platform repos where this service's artifacts live. */
4232
+ targetPathHint?: string;
4233
+ };
4234
+ DeliveryTopologyDto: {
4235
+ /** @enum {string} */
4236
+ deliveryModel: "auto" | "k8s_microservices" | "mobile_store" | "web_hosting" | "data_pipelines" | "monorepo" | "library" | "hybrid";
4237
+ /** @enum {string} */
4238
+ ciProvider: "github_actions" | "jenkins" | "gitlab" | "bitbucket" | "hybrid" | "external_documented";
4239
+ /** @description True when infra/delivery artifacts live outside service repos. */
4240
+ splitInfra: boolean;
4241
+ /** @description Role → platform repo mapping. Known keys: terraform, gitops, ci_templates, jenkins_shared, mobile_release, hosting, data_platform, api_contracts, sonar_config. */
4242
+ roles: {
4243
+ [key: string]: components["schemas"]["DeliveryRoleConfigDto"];
4244
+ };
4245
+ /** @description Optional path template inside platform repos, e.g. `services/{repo_name}/` (`{repo_name}` and `{provider_slug}` placeholders supported). */
4246
+ servicePathConvention?: string | null;
4247
+ /** @description Per-service-repo overrides keyed by provider slug. */
4248
+ repoOverrides: {
4249
+ [key: string]: components["schemas"]["RepoDeliveryOverrideDto"];
4250
+ };
4152
4251
  };
4153
4252
  TestConnectionResponseDto: {
4154
4253
  success: boolean;
@@ -4158,11 +4257,11 @@ export interface components {
4158
4257
  executionKeyValid?: boolean | null;
4159
4258
  /** @description Error detail when `executionKeyValid` is false. */
4160
4259
  executionKeyError?: string | null;
4161
- /** @description Present for New Relic or Grafana verify success — authenticated user name. */
4260
+ /** @description Present for New Relic, Grafana, PagerDuty, or Jira verify success — authenticated user name. */
4162
4261
  userName?: string;
4163
4262
  /** @description Present for New Relic verify success — resolved account display name. */
4164
4263
  accountName?: string;
4165
- /** @description Present for New Relic verify success — resolved account ID. */
4264
+ /** @description Present for New Relic or Jira verify success — resolved account ID. */
4166
4265
  accountId?: string;
4167
4266
  /** @description Present for Grafana verify success — resolved organization name. */
4168
4267
  orgName?: string;
@@ -6336,6 +6435,33 @@ export interface components {
6336
6435
  }[] | null;
6337
6436
  /** @description GitHub-reported repository size in KB (includes git history), refreshed on each readiness scan (#729). Compare against `eligibilityLimits.maxRepoSizeKb` on the list response to show per-repo "size / limit". When the size exceeds the limit the latest scan is recorded as `partial_failed` with `lastRunErrorCode = exceeded_repo_size_limit` and the repo is marked `ineligible`. Null until a scan has populated it. */
6338
6437
  sizeKb?: number | null;
6438
+ /**
6439
+ * @description Federated readiness: set when the repo was classified as a platform repository and scored with the reduced platform rubric profile. Null for service repos. The UI shows a "Platform repository" badge instead of comparing its score against service repos.
6440
+ * @enum {string|null}
6441
+ */
6442
+ platformArchetype?: "terraform_platform" | "gitops_platform" | "ci_templates" | "api_contracts_platform" | null;
6443
+ /** @description Federated readiness completeness for service repos: which linked platform roles (terraform/gitops/ci_templates/api_contracts, from the workspace delivery topology) are still missing scan evidence. Absent/null when no topology is configured or every declared role has fresh metadata (`complete: true`). */
6444
+ linkedRoleAssessment?: components["schemas"]["LinkedRoleAssessmentDto"] | null;
6445
+ };
6446
+ LinkedRolePendingDto: {
6447
+ /** @description Topology role key, e.g. terraform | gitops | ci_templates | api_contracts. */
6448
+ role: string;
6449
+ /** @description Platform repo (`owner/repo`) that must be scanned to satisfy this role. */
6450
+ providerSlug: string;
6451
+ /**
6452
+ * @description `no_scan` — the platform repo has no successful readiness run yet; `no_metadata_emitted` — it was scanned but emitted no linkage for this service (wrong archetype or scan predates federated readiness); `stale` — metadata is older than the hard TTL (30 days) and must be refreshed by re-scanning the platform repo.
6453
+ * @enum {string}
6454
+ */
6455
+ reason: "no_scan" | "no_metadata_emitted" | "stale";
6456
+ /**
6457
+ * Format: date-time
6458
+ * @description Latest succeeded scan of the platform repo, when one exists.
6459
+ */
6460
+ lastRunAt?: string | null;
6461
+ };
6462
+ LinkedRoleAssessmentDto: {
6463
+ complete: boolean;
6464
+ pending: components["schemas"]["LinkedRolePendingDto"][];
6339
6465
  };
6340
6466
  /** @description Single-repo detail response. Identical to RepoReadinessScoreDto except dimensions use DimensionScoreDetailDto (criteriaDetails required per dimension). */
6341
6467
  RepoReadinessScoreDetailDto: {
@@ -6387,6 +6513,13 @@ export interface components {
6387
6513
  }[] | null;
6388
6514
  /** @description GitHub-reported repository size in KB, refreshed on each scan. See RepoReadinessScoreDto.sizeKb. */
6389
6515
  sizeKb?: number | null;
6516
+ /**
6517
+ * @description See RepoReadinessScoreDto.platformArchetype.
6518
+ * @enum {string|null}
6519
+ */
6520
+ platformArchetype?: "terraform_platform" | "gitops_platform" | "ci_templates" | "api_contracts_platform" | null;
6521
+ /** @description See RepoReadinessScoreDto.linkedRoleAssessment. */
6522
+ linkedRoleAssessment?: components["schemas"]["LinkedRoleAssessmentDto"] | null;
6390
6523
  };
6391
6524
  AgenticFoundationDashboardSummaryDto: {
6392
6525
  repoCount: number;
@@ -8253,9 +8386,14 @@ export type SonarQubeRepoMappingValidateRowDto = components['schemas']['SonarQub
8253
8386
  export type SonarQubeRepoMappingsValidateResponseDto = components['schemas']['SonarQubeRepoMappingsValidateResponseDto'];
8254
8387
  export type PagerDutySourceDto = components['schemas']['PagerDutySourceDto'];
8255
8388
  export type PagerDutySourceConfigDto = components['schemas']['PagerDutySourceConfigDto'];
8389
+ export type JiraSourceDto = components['schemas']['JiraSourceDto'];
8390
+ export type JiraSourceConfigDto = components['schemas']['JiraSourceConfigDto'];
8256
8391
  export type AgentExecutionProviderDto = components['schemas']['AgentExecutionProviderDto'];
8257
8392
  export type PutCodeIntelligenceSettingsDto = components['schemas']['PutCodeIntelligenceSettingsDto'];
8258
8393
  export type WorkspaceConfigDto = components['schemas']['WorkspaceConfigDto'];
8394
+ export type DeliveryRoleConfigDto = components['schemas']['DeliveryRoleConfigDto'];
8395
+ export type RepoDeliveryOverrideDto = components['schemas']['RepoDeliveryOverrideDto'];
8396
+ export type DeliveryTopologyDto = components['schemas']['DeliveryTopologyDto'];
8259
8397
  export type TestConnectionResponseDto = components['schemas']['TestConnectionResponseDto'];
8260
8398
  export type CursorKeyUsageDto = components['schemas']['CursorKeyUsageDto'];
8261
8399
  export type AiToolSeatDto = components['schemas']['AiToolSeatDto'];
@@ -8429,6 +8567,8 @@ export type ReadinessScoreHistoryPointDto = components['schemas']['ReadinessScor
8429
8567
  export type ReadinessRepoScoreHistoryDto = components['schemas']['ReadinessRepoScoreHistoryDto'];
8430
8568
  export type WorkspaceReadinessScoreHistoryDto = components['schemas']['WorkspaceReadinessScoreHistoryDto'];
8431
8569
  export type RepoReadinessScoreDto = components['schemas']['RepoReadinessScoreDto'];
8570
+ export type LinkedRolePendingDto = components['schemas']['LinkedRolePendingDto'];
8571
+ export type LinkedRoleAssessmentDto = components['schemas']['LinkedRoleAssessmentDto'];
8432
8572
  export type RepoReadinessScoreDetailDto = components['schemas']['RepoReadinessScoreDetailDto'];
8433
8573
  export type AgenticFoundationDashboardSummaryDto = components['schemas']['AgenticFoundationDashboardSummaryDto'];
8434
8574
  export type PageMetaDto = components['schemas']['PageMetaDto'];
@@ -10207,6 +10347,50 @@ export interface operations {
10207
10347
  };
10208
10348
  };
10209
10349
  };
10350
+ putWorkspaceDeliveryTopology: {
10351
+ parameters: {
10352
+ query?: never;
10353
+ header?: never;
10354
+ path: {
10355
+ workspaceId: components["parameters"]["WorkspaceId"];
10356
+ };
10357
+ cookie?: never;
10358
+ };
10359
+ requestBody: {
10360
+ content: {
10361
+ "application/json": components["schemas"]["DeliveryTopologyDto"] | null;
10362
+ };
10363
+ };
10364
+ responses: {
10365
+ /** @description Topology persisted (or cleared). */
10366
+ 204: {
10367
+ headers: {
10368
+ [name: string]: unknown;
10369
+ };
10370
+ content?: never;
10371
+ };
10372
+ /** @description Invalid topology payload or unconnected repo referenced. */
10373
+ 400: {
10374
+ headers: {
10375
+ [name: string]: unknown;
10376
+ };
10377
+ content: {
10378
+ "application/json": components["schemas"]["ErrorMessageDto"];
10379
+ };
10380
+ };
10381
+ 401: components["responses"]["Unauthorized"];
10382
+ 403: components["responses"]["Forbidden"];
10383
+ /** @description Workspace does not exist or malformed workspaceId */
10384
+ 404: {
10385
+ headers: {
10386
+ [name: string]: unknown;
10387
+ };
10388
+ content: {
10389
+ "application/json": components["schemas"]["ErrorMessageDto"];
10390
+ };
10391
+ };
10392
+ };
10393
+ };
10210
10394
  putTenantSources: {
10211
10395
  parameters: {
10212
10396
  query?: never;
@@ -10219,7 +10403,7 @@ export interface operations {
10219
10403
  requestBody: {
10220
10404
  content: {
10221
10405
  "application/json": {
10222
- 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"])[];
10406
+ 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"])[];
10223
10407
  };
10224
10408
  };
10225
10409
  };
@@ -10273,7 +10457,7 @@ export interface operations {
10273
10457
  };
10274
10458
  requestBody: {
10275
10459
  content: {
10276
- "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"];
10460
+ "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"];
10277
10461
  };
10278
10462
  };
10279
10463
  responses: {