@thinkai/tai-api-contract 2.96.0 → 2.98.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.
@@ -561,6 +561,27 @@ export interface paths {
561
561
  patch?: never;
562
562
  trace?: never;
563
563
  };
564
+ "/workspaces/{workspaceId}/delivery-topology": {
565
+ parameters: {
566
+ query?: never;
567
+ header?: never;
568
+ path?: never;
569
+ cookie?: never;
570
+ };
571
+ get?: never;
572
+ /**
573
+ * Set workspace delivery topology
574
+ * @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.
575
+ * Requires editor or admin workspace role.
576
+ */
577
+ put: operations["putWorkspaceDeliveryTopology"];
578
+ post?: never;
579
+ delete?: never;
580
+ options?: never;
581
+ head?: never;
582
+ patch?: never;
583
+ trace?: never;
584
+ };
564
585
  "/workspaces/{workspaceId}/sources": {
565
586
  parameters: {
566
587
  query?: never;
@@ -4182,6 +4203,52 @@ export interface components {
4182
4203
  codeIntelligenceClaudeModel?: string | null;
4183
4204
  /** @description True when a dedicated `code_intelligence` source has a stored executionToken. */
4184
4205
  hasCodeIntelligenceExecutionToken?: boolean;
4206
+ /** @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`. */
4207
+ deliveryTopology?: components["schemas"]["DeliveryTopologyDto"] | null;
4208
+ };
4209
+ DeliveryRoleConfigDto: {
4210
+ /** @description Connected workspace repo (`owner/repo`) that holds this role's artifacts. */
4211
+ providerSlug: string;
4212
+ /**
4213
+ * @description IaC engine hint (terraform role only).
4214
+ * @enum {string}
4215
+ */
4216
+ engine?: "terraform" | "pulumi" | "cdk";
4217
+ /**
4218
+ * @description CI templates flavor (ci_templates role only).
4219
+ * @enum {string}
4220
+ */
4221
+ type?: "reusable_workflows";
4222
+ /** @description Set true for extension roles outside the known role keys. */
4223
+ custom?: boolean;
4224
+ };
4225
+ RepoDeliveryOverrideDto: {
4226
+ /** @enum {string} */
4227
+ deliveryModel?: "auto" | "k8s_microservices" | "mobile_store" | "web_hosting" | "data_pipelines" | "monorepo" | "library" | "hybrid";
4228
+ /** @description Per-service role → providerSlug overrides (merged over workspace roles). */
4229
+ roles?: {
4230
+ [key: string]: string;
4231
+ };
4232
+ /** @description Path prefix inside platform repos where this service's artifacts live. */
4233
+ targetPathHint?: string;
4234
+ };
4235
+ DeliveryTopologyDto: {
4236
+ /** @enum {string} */
4237
+ deliveryModel: "auto" | "k8s_microservices" | "mobile_store" | "web_hosting" | "data_pipelines" | "monorepo" | "library" | "hybrid";
4238
+ /** @enum {string} */
4239
+ ciProvider: "github_actions" | "jenkins" | "gitlab" | "bitbucket" | "hybrid" | "external_documented";
4240
+ /** @description True when infra/delivery artifacts live outside service repos. */
4241
+ splitInfra: boolean;
4242
+ /** @description Role → platform repo mapping. Known keys: terraform, gitops, ci_templates, jenkins_shared, mobile_release, hosting, data_platform, api_contracts, sonar_config. */
4243
+ roles: {
4244
+ [key: string]: components["schemas"]["DeliveryRoleConfigDto"];
4245
+ };
4246
+ /** @description Optional path template inside platform repos, e.g. `services/{repo_name}/` (`{repo_name}` and `{provider_slug}` placeholders supported). */
4247
+ servicePathConvention?: string | null;
4248
+ /** @description Per-service-repo overrides keyed by provider slug. */
4249
+ repoOverrides: {
4250
+ [key: string]: components["schemas"]["RepoDeliveryOverrideDto"];
4251
+ };
4185
4252
  };
4186
4253
  TestConnectionResponseDto: {
4187
4254
  success: boolean;
@@ -4575,13 +4642,17 @@ export interface components {
4575
4642
  failures: string[];
4576
4643
  /** @description Failed GitHub Actions workflow runs for this UTC day when CI ingest is enabled. */
4577
4644
  failureItems?: components["schemas"]["ProductivityInsightsContributorFailureItemDto"][];
4578
- /** @description Optional PR rows with GitHub links when ingest stored URLs. */
4645
+ /** @description Optional merged PR rows for day drilldown (label, optional GitHub URL, optional ship-weight score / pending flag). Includes label-only rows so unscored or URL-less merges still surface ship-weight state. */
4579
4646
  mergedPrItems?: components["schemas"]["ProductivityInsightsContributorMergedPrItemDto"][];
4580
4647
  };
4581
4648
  ProductivityInsightsContributorMergedPrItemDto: {
4582
4649
  label: string;
4583
4650
  /** Format: uri */
4584
4651
  url?: string;
4652
+ /** @description v13 ship-weight score for this PR when scored (typically 0–10). */
4653
+ shipWeight?: number;
4654
+ /** @description True when this GitHub PR is still awaiting ship-weight scoring. */
4655
+ shipWeightPending?: boolean;
4585
4656
  };
4586
4657
  ProductivityInsightsContributorFailureItemDto: {
4587
4658
  label: string;
@@ -6369,6 +6440,33 @@ export interface components {
6369
6440
  }[] | null;
6370
6441
  /** @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. */
6371
6442
  sizeKb?: number | null;
6443
+ /**
6444
+ * @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.
6445
+ * @enum {string|null}
6446
+ */
6447
+ platformArchetype?: "terraform_platform" | "gitops_platform" | "ci_templates" | "api_contracts_platform" | null;
6448
+ /** @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`). */
6449
+ linkedRoleAssessment?: components["schemas"]["LinkedRoleAssessmentDto"] | null;
6450
+ };
6451
+ LinkedRolePendingDto: {
6452
+ /** @description Topology role key, e.g. terraform | gitops | ci_templates | api_contracts. */
6453
+ role: string;
6454
+ /** @description Platform repo (`owner/repo`) that must be scanned to satisfy this role. */
6455
+ providerSlug: string;
6456
+ /**
6457
+ * @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.
6458
+ * @enum {string}
6459
+ */
6460
+ reason: "no_scan" | "no_metadata_emitted" | "stale";
6461
+ /**
6462
+ * Format: date-time
6463
+ * @description Latest succeeded scan of the platform repo, when one exists.
6464
+ */
6465
+ lastRunAt?: string | null;
6466
+ };
6467
+ LinkedRoleAssessmentDto: {
6468
+ complete: boolean;
6469
+ pending: components["schemas"]["LinkedRolePendingDto"][];
6372
6470
  };
6373
6471
  /** @description Single-repo detail response. Identical to RepoReadinessScoreDto except dimensions use DimensionScoreDetailDto (criteriaDetails required per dimension). */
6374
6472
  RepoReadinessScoreDetailDto: {
@@ -6420,6 +6518,13 @@ export interface components {
6420
6518
  }[] | null;
6421
6519
  /** @description GitHub-reported repository size in KB, refreshed on each scan. See RepoReadinessScoreDto.sizeKb. */
6422
6520
  sizeKb?: number | null;
6521
+ /**
6522
+ * @description See RepoReadinessScoreDto.platformArchetype.
6523
+ * @enum {string|null}
6524
+ */
6525
+ platformArchetype?: "terraform_platform" | "gitops_platform" | "ci_templates" | "api_contracts_platform" | null;
6526
+ /** @description See RepoReadinessScoreDto.linkedRoleAssessment. */
6527
+ linkedRoleAssessment?: components["schemas"]["LinkedRoleAssessmentDto"] | null;
6423
6528
  };
6424
6529
  AgenticFoundationDashboardSummaryDto: {
6425
6530
  repoCount: number;
@@ -7426,6 +7531,8 @@ export interface components {
7426
7531
  /** Format: date */
7427
7532
  weekStartIso: string;
7428
7533
  mergedPrs: number;
7534
+ /** @description Sum of ship-weight scores for merged PRs in this week bucket. */
7535
+ shipWeightSum?: number;
7429
7536
  ciFailRatePct: number;
7430
7537
  /** @description False when CI metrics were not available for this week bucket. */
7431
7538
  hasCiMetrics?: boolean;
@@ -7434,6 +7541,8 @@ export interface components {
7434
7541
  weeks: components["schemas"]["InsightsVelocityQualityWeek"][];
7435
7542
  targetFailRatePct: number;
7436
7543
  volumeGrowthPct: number;
7544
+ /** @description Ship-weight volume growth vs the prior equal-length window. */
7545
+ shipWeightVolumeGrowthPct?: number;
7437
7546
  };
7438
7547
  InsightsRecommendationsVelocityQualityResponse: components["schemas"]["InsightsRecommendationsVelocityQuality"] & {
7439
7548
  _meta: components["schemas"]["InsightsResponseMeta"];
@@ -8291,6 +8400,9 @@ export type JiraSourceConfigDto = components['schemas']['JiraSourceConfigDto'];
8291
8400
  export type AgentExecutionProviderDto = components['schemas']['AgentExecutionProviderDto'];
8292
8401
  export type PutCodeIntelligenceSettingsDto = components['schemas']['PutCodeIntelligenceSettingsDto'];
8293
8402
  export type WorkspaceConfigDto = components['schemas']['WorkspaceConfigDto'];
8403
+ export type DeliveryRoleConfigDto = components['schemas']['DeliveryRoleConfigDto'];
8404
+ export type RepoDeliveryOverrideDto = components['schemas']['RepoDeliveryOverrideDto'];
8405
+ export type DeliveryTopologyDto = components['schemas']['DeliveryTopologyDto'];
8294
8406
  export type TestConnectionResponseDto = components['schemas']['TestConnectionResponseDto'];
8295
8407
  export type CursorKeyUsageDto = components['schemas']['CursorKeyUsageDto'];
8296
8408
  export type AiToolSeatDto = components['schemas']['AiToolSeatDto'];
@@ -8464,6 +8576,8 @@ export type ReadinessScoreHistoryPointDto = components['schemas']['ReadinessScor
8464
8576
  export type ReadinessRepoScoreHistoryDto = components['schemas']['ReadinessRepoScoreHistoryDto'];
8465
8577
  export type WorkspaceReadinessScoreHistoryDto = components['schemas']['WorkspaceReadinessScoreHistoryDto'];
8466
8578
  export type RepoReadinessScoreDto = components['schemas']['RepoReadinessScoreDto'];
8579
+ export type LinkedRolePendingDto = components['schemas']['LinkedRolePendingDto'];
8580
+ export type LinkedRoleAssessmentDto = components['schemas']['LinkedRoleAssessmentDto'];
8467
8581
  export type RepoReadinessScoreDetailDto = components['schemas']['RepoReadinessScoreDetailDto'];
8468
8582
  export type AgenticFoundationDashboardSummaryDto = components['schemas']['AgenticFoundationDashboardSummaryDto'];
8469
8583
  export type PageMetaDto = components['schemas']['PageMetaDto'];
@@ -10242,6 +10356,50 @@ export interface operations {
10242
10356
  };
10243
10357
  };
10244
10358
  };
10359
+ putWorkspaceDeliveryTopology: {
10360
+ parameters: {
10361
+ query?: never;
10362
+ header?: never;
10363
+ path: {
10364
+ workspaceId: components["parameters"]["WorkspaceId"];
10365
+ };
10366
+ cookie?: never;
10367
+ };
10368
+ requestBody: {
10369
+ content: {
10370
+ "application/json": components["schemas"]["DeliveryTopologyDto"] | null;
10371
+ };
10372
+ };
10373
+ responses: {
10374
+ /** @description Topology persisted (or cleared). */
10375
+ 204: {
10376
+ headers: {
10377
+ [name: string]: unknown;
10378
+ };
10379
+ content?: never;
10380
+ };
10381
+ /** @description Invalid topology payload or unconnected repo referenced. */
10382
+ 400: {
10383
+ headers: {
10384
+ [name: string]: unknown;
10385
+ };
10386
+ content: {
10387
+ "application/json": components["schemas"]["ErrorMessageDto"];
10388
+ };
10389
+ };
10390
+ 401: components["responses"]["Unauthorized"];
10391
+ 403: components["responses"]["Forbidden"];
10392
+ /** @description Workspace does not exist or malformed workspaceId */
10393
+ 404: {
10394
+ headers: {
10395
+ [name: string]: unknown;
10396
+ };
10397
+ content: {
10398
+ "application/json": components["schemas"]["ErrorMessageDto"];
10399
+ };
10400
+ };
10401
+ };
10402
+ };
10245
10403
  putTenantSources: {
10246
10404
  parameters: {
10247
10405
  query?: never;
package/src/index.ts CHANGED
@@ -686,6 +686,10 @@ export interface ProductivityInsightsContributorProfileDto {
686
686
  export interface ProductivityInsightsContributorMergedPrItemDto {
687
687
  label: string;
688
688
  url?: string;
689
+ /** v13 ship-weight score for this PR when scored. */
690
+ shipWeight?: number;
691
+ /** True when this PR is still awaiting ship-weight scoring. */
692
+ shipWeightPending?: boolean;
689
693
  }
690
694
 
691
695
  /** One failed GitHub Actions workflow run on a contributor activity day. */
@@ -1617,6 +1621,8 @@ export interface InsightsRecommendationsRoiQuadrant {
1617
1621
  export interface InsightsVelocityQualityWeek {
1618
1622
  weekStartIso: string;
1619
1623
  mergedPrs: number;
1624
+ /** Sum of ship-weight scores for merged PRs in this week bucket. */
1625
+ shipWeightSum?: number;
1620
1626
  ciFailRatePct: number;
1621
1627
  /** False when CI metrics were not available for this week bucket. */
1622
1628
  hasCiMetrics?: boolean;
@@ -1626,6 +1632,8 @@ export interface InsightsRecommendationsVelocityQuality {
1626
1632
  weeks: InsightsVelocityQualityWeek[];
1627
1633
  targetFailRatePct: number;
1628
1634
  volumeGrowthPct: number;
1635
+ /** Ship-weight volume growth vs prior equal-length window. */
1636
+ shipWeightVolumeGrowthPct?: number;
1629
1637
  }
1630
1638
 
1631
1639
  export const INSIGHTS_REVIEW_STAGE_IDS = [