@thinkai/tai-api-contract 2.186.0 → 2.188.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.
@@ -3343,6 +3343,46 @@ export interface paths {
3343
3343
  patch?: never;
3344
3344
  trace?: never;
3345
3345
  };
3346
+ "/workspaces/{workspaceId}/rules-skills/validate": {
3347
+ parameters: {
3348
+ query?: never;
3349
+ header?: never;
3350
+ path?: never;
3351
+ cookie?: never;
3352
+ };
3353
+ get?: never;
3354
+ put?: never;
3355
+ /**
3356
+ * Validate agent rules and skills for a repository
3357
+ * @description Clones the connected GitHub repository via the workspace GitHub App installation and runs the shared Rules & Skills validate engine (structural + soft quality). Assessed tools come from the latest **succeeded** readiness scan (`agent_tool_assessed`: `cursor` | `claude-code` | `both`). Returns draft `proposedFiles` for review (not committed). Workspace member auth; write permissions are not required for validate-only.
3358
+ */
3359
+ post: operations["postRulesSkillsValidate"];
3360
+ delete?: never;
3361
+ options?: never;
3362
+ head?: never;
3363
+ patch?: never;
3364
+ trace?: never;
3365
+ };
3366
+ "/workspaces/{workspaceId}/rules-skills/pull-requests": {
3367
+ parameters: {
3368
+ query?: never;
3369
+ header?: never;
3370
+ path?: never;
3371
+ cookie?: never;
3372
+ };
3373
+ get?: never;
3374
+ put?: never;
3375
+ /**
3376
+ * Open a Rules & Skills remediation pull request
3377
+ * @description Applies `proposedFiles` (or a future create-mode session) onto a non-default branch via the Automations GitHub App installation and opens a pull request. Never pushes to the default branch. PR title/body identify the change as platform-generated and link back to `/agentic-foundation/rules-skills`. Requires workspace editor or admin. Same write-permission gate as readiness fixes.
3378
+ */
3379
+ post: operations["postRulesSkillsPullRequest"];
3380
+ delete?: never;
3381
+ options?: never;
3382
+ head?: never;
3383
+ patch?: never;
3384
+ trace?: never;
3385
+ };
3346
3386
  "/workspaces/{workspaceId}/readiness/issues/{issueId}/fix-guide": {
3347
3387
  parameters: {
3348
3388
  query?: never;
@@ -6955,13 +6995,52 @@ export interface components {
6955
6995
  generatedAt: string;
6956
6996
  contributors: components["schemas"]["AiUsageSpendAggregatedContributorRowDto"][];
6957
6997
  };
6998
+ /** @description Numeric evidence for `id=model_right_sizing` (Cost-to-Value insight #2). Premium share is `premiumSpendCents / totalModelSpendCents` against `thresholdPct` (Phase A default 40). */
6999
+ AiUsageSpendKeyInsightModelRightSizingEvidenceDto: {
7000
+ /** @description Premium-model share of model spend in the window (0–100). */
7001
+ premiumSharePct: number;
7002
+ /** @description Sum of spend_cents on premium-classified models (cents). */
7003
+ premiumSpendCents: number;
7004
+ /** @description Sum of spend_cents across all models in the window (cents). */
7005
+ totalModelSpendCents: number;
7006
+ /** @description Effective premium-share threshold used for this card (0–100). */
7007
+ thresholdPct: number;
7008
+ /** @description Distinct mapped person_id rows contributing to this card's sample (workspace rollup or the single person for a person-scoped card). */
7009
+ personCount: number;
7010
+ };
7011
+ /** @description Optional member drill-down for person-scoped `model_right_sizing` cards. Links to `GET …/integrations/ai-tool/{provider}/members/{externalId}`. */
7012
+ AiUsageSpendKeyInsightDrilldownDto: {
7013
+ /**
7014
+ * @description AI tool provider for the member detail route.
7015
+ * @enum {string}
7016
+ */
7017
+ provider: "cursor" | "claude";
7018
+ /** @description Provider member external id for the member detail route. */
7019
+ externalId: string;
7020
+ };
7021
+ /** @description One Key Insights panel card. Base fields (`id`, `tone`, `text`) apply to all insights. When `id` is `model_right_sizing`, clients MUST treat `dataQuality`, `limitation`, `recommendedAction`, and `evidence` as required; `scope` and `drilldown` are optional (person cards may set both). */
6958
7022
  AiUsageSpendKeyInsightItemDto: {
6959
- /** @description Stable insight key (e.g. spend-leader, spend-vs-output). */
7023
+ /** @description Stable insight key (e.g. spend-leader, spend-vs-output, model_right_sizing). */
6960
7024
  id: string;
6961
7025
  /** @enum {string} */
6962
7026
  tone: "positive" | "warning" | "neutral";
6963
7027
  /** @description Human-readable insight sentence for the UI panel. */
6964
7028
  text: string;
7029
+ /** @description Required when `id=model_right_sizing`. Phase A/B always `estimated` (model-mix heuristic; no task-complexity telemetry until Phase 3). */
7030
+ dataQuality?: components["schemas"]["AiAssistedCodeDataQuality"];
7031
+ /** @description Required when `id=model_right_sizing`. Fixed honesty string that the model mix is heuristic and does not encode task complexity. */
7032
+ limitation?: string;
7033
+ /** @description Required when `id=model_right_sizing`. Coaching copy for the card CTA (advisory only; not vendor enforcement). */
7034
+ recommendedAction?: string;
7035
+ /** @description Required when `id=model_right_sizing`. */
7036
+ evidence?: components["schemas"]["AiUsageSpendKeyInsightModelRightSizingEvidenceDto"];
7037
+ /**
7038
+ * @description Optional scope for `model_right_sizing` cards. Workspace default vs per-person personalized item.
7039
+ * @enum {string}
7040
+ */
7041
+ scope?: "workspace" | "person";
7042
+ /** @description Optional when `scope=person` for `model_right_sizing`; omitted on workspace cards. */
7043
+ drilldown?: components["schemas"]["AiUsageSpendKeyInsightDrilldownDto"];
6965
7044
  };
6966
7045
  AiUsageSpendKeyInsightsDto: {
6967
7046
  /** Format: uuid */
@@ -9203,6 +9282,80 @@ export interface components {
9203
9282
  /** @description Required when the issue has unresolvedChoices. Must be one of those labels. Stored on the fix row and stated in the worker prompt. */
9204
9283
  patternChoice?: string;
9205
9284
  };
9285
+ /**
9286
+ * @description From the latest succeeded readiness scan (`agent_tool_assessed`). Never invent `both` without scan evidence.
9287
+ * @enum {string}
9288
+ */
9289
+ RulesSkillsAssessedTools: "cursor" | "claude-code" | "both";
9290
+ RulesSkillsValidateRequestDto: {
9291
+ /** Format: uuid */
9292
+ repoId: string;
9293
+ /** @description Optional relative path prefixes limiting the validate walk. */
9294
+ pathPrefixes?: string[];
9295
+ };
9296
+ RulesSkillsFindingDto: {
9297
+ id: string;
9298
+ /** @enum {string} */
9299
+ kind: "structural" | "soft";
9300
+ /** @enum {string} */
9301
+ severity: "fail" | "warn";
9302
+ code: string;
9303
+ path: string;
9304
+ message: string;
9305
+ /** @description Empty when unmapped structural noise. */
9306
+ criterionIds: ("A1" | "A2" | "A3" | "A3a" | "A3b" | "A3c" | "A11")[];
9307
+ };
9308
+ RulesSkillsSoftQualityCheckDto: {
9309
+ code: string;
9310
+ /** @enum {string} */
9311
+ status: "pass" | "fail" | "warn" | "skip";
9312
+ message?: string;
9313
+ path?: string;
9314
+ };
9315
+ RulesSkillsSoftQualitySummaryDto: {
9316
+ /** @description True when there are no soft-quality fail findings (warns allowed). */
9317
+ passed: boolean;
9318
+ failCount: number;
9319
+ warnCount: number;
9320
+ checks: components["schemas"]["RulesSkillsSoftQualityCheckDto"][];
9321
+ };
9322
+ RulesSkillsProposedFileDto: {
9323
+ path: string;
9324
+ /** @enum {string} */
9325
+ action: "create" | "update" | "delete" | "rename";
9326
+ /** @description Full file contents for create/update/rename target. */
9327
+ content?: string;
9328
+ /** @description Source path when action is rename. */
9329
+ previousPath?: string;
9330
+ };
9331
+ RulesSkillsValidateResponseDto: {
9332
+ assessedTools: components["schemas"]["RulesSkillsAssessedTools"];
9333
+ findings: components["schemas"]["RulesSkillsFindingDto"][];
9334
+ softQualitySummary: components["schemas"]["RulesSkillsSoftQualitySummaryDto"];
9335
+ proposedFiles: components["schemas"]["RulesSkillsProposedFileDto"][];
9336
+ /** @description Quiet-case note (e.g. empty tree under pathPrefixes). */
9337
+ note?: string;
9338
+ };
9339
+ RulesSkillsOpenPullRequestRequestDto: {
9340
+ /** Format: uuid */
9341
+ repoId: string;
9342
+ /** @enum {string} */
9343
+ mode: "validate" | "create";
9344
+ /**
9345
+ * Format: uuid
9346
+ * @description Reserved for Create-mode sessions; validate mode uses proposedFiles.
9347
+ */
9348
+ sessionId?: string;
9349
+ proposedFiles?: components["schemas"]["RulesSkillsProposedFileDto"][];
9350
+ title?: string;
9351
+ body?: string;
9352
+ };
9353
+ RulesSkillsOpenPullRequestResponseDto: {
9354
+ /** Format: uri */
9355
+ prUrl: string;
9356
+ prNumber: number;
9357
+ branchName: string;
9358
+ };
9206
9359
  PhaseRoleDto: {
9207
9360
  phase: string;
9208
9361
  /** @enum {string} */
@@ -12900,6 +13053,8 @@ export type AiUsageSpendAggregatedTeamsDto = components['schemas']['AiUsageSpend
12900
13053
  export type AiUsageSpendAggregatedContributorRowDto = components['schemas']['AiUsageSpendAggregatedContributorRowDto'];
12901
13054
  export type AiUsageSpendAggregatedContributorsDto = components['schemas']['AiUsageSpendAggregatedContributorsDto'];
12902
13055
  export type AiUsageSpendContributorToolHeatmapDto = components['schemas']['AiUsageSpendContributorToolHeatmapDto'];
13056
+ export type AiUsageSpendKeyInsightModelRightSizingEvidenceDto = components['schemas']['AiUsageSpendKeyInsightModelRightSizingEvidenceDto'];
13057
+ export type AiUsageSpendKeyInsightDrilldownDto = components['schemas']['AiUsageSpendKeyInsightDrilldownDto'];
12903
13058
  export type AiUsageSpendKeyInsightItemDto = components['schemas']['AiUsageSpendKeyInsightItemDto'];
12904
13059
  export type AiUsageSpendKeyInsightsDto = components['schemas']['AiUsageSpendKeyInsightsDto'];
12905
13060
  export type AiAssistedCodeDataQuality = components['schemas']['AiAssistedCodeDataQuality'];
@@ -13090,6 +13245,15 @@ export type ReadinessFixGuideDto = components['schemas']['ReadinessFixGuideDto']
13090
13245
  export type FixRetryableErrorCode = components['schemas']['FixRetryableErrorCode'];
13091
13246
  export type FixNonRetryableErrorCode = components['schemas']['FixNonRetryableErrorCode'];
13092
13247
  export type CreateFixRequestBodyDto = components['schemas']['CreateFixRequestBodyDto'];
13248
+ export type RulesSkillsAssessedTools = components['schemas']['RulesSkillsAssessedTools'];
13249
+ export type RulesSkillsValidateRequestDto = components['schemas']['RulesSkillsValidateRequestDto'];
13250
+ export type RulesSkillsFindingDto = components['schemas']['RulesSkillsFindingDto'];
13251
+ export type RulesSkillsSoftQualityCheckDto = components['schemas']['RulesSkillsSoftQualityCheckDto'];
13252
+ export type RulesSkillsSoftQualitySummaryDto = components['schemas']['RulesSkillsSoftQualitySummaryDto'];
13253
+ export type RulesSkillsProposedFileDto = components['schemas']['RulesSkillsProposedFileDto'];
13254
+ export type RulesSkillsValidateResponseDto = components['schemas']['RulesSkillsValidateResponseDto'];
13255
+ export type RulesSkillsOpenPullRequestRequestDto = components['schemas']['RulesSkillsOpenPullRequestRequestDto'];
13256
+ export type RulesSkillsOpenPullRequestResponseDto = components['schemas']['RulesSkillsOpenPullRequestResponseDto'];
13093
13257
  export type PhaseRoleDto = components['schemas']['PhaseRoleDto'];
13094
13258
  export type SquadMemberDto = components['schemas']['SquadMemberDto'];
13095
13259
  export type CustomWorkStreamTaskDto = components['schemas']['CustomWorkStreamTaskDto'];
@@ -22826,6 +22990,134 @@ export interface operations {
22826
22990
  };
22827
22991
  };
22828
22992
  };
22993
+ postRulesSkillsValidate: {
22994
+ parameters: {
22995
+ query?: never;
22996
+ header?: never;
22997
+ path: {
22998
+ workspaceId: components["parameters"]["WorkspaceId"];
22999
+ };
23000
+ cookie?: never;
23001
+ };
23002
+ requestBody: {
23003
+ content: {
23004
+ "application/json": components["schemas"]["RulesSkillsValidateRequestDto"];
23005
+ };
23006
+ };
23007
+ responses: {
23008
+ /** @description Validation result with findings and draft proposed files */
23009
+ 200: {
23010
+ headers: {
23011
+ [name: string]: unknown;
23012
+ };
23013
+ content: {
23014
+ "application/json": components["schemas"]["RulesSkillsValidateResponseDto"];
23015
+ };
23016
+ };
23017
+ /** @description Invalid body (e.g. malformed repoId) */
23018
+ 400: {
23019
+ headers: {
23020
+ [name: string]: unknown;
23021
+ };
23022
+ content: {
23023
+ "application/json": components["schemas"]["ErrorMessageDto"];
23024
+ };
23025
+ };
23026
+ 401: components["responses"]["Unauthorized"];
23027
+ 403: components["responses"]["Forbidden"];
23028
+ /** @description Workspace or repository not found / not connected */
23029
+ 404: {
23030
+ headers: {
23031
+ [name: string]: unknown;
23032
+ };
23033
+ content: {
23034
+ "application/json": components["schemas"]["ErrorMessageDto"];
23035
+ };
23036
+ };
23037
+ /** @description No succeeded readiness scan for the repo (`code: readiness_scan_required`), or repository is not a GitHub-connected readiness repo. */
23038
+ 422: {
23039
+ headers: {
23040
+ [name: string]: unknown;
23041
+ };
23042
+ content: {
23043
+ "application/json": components["schemas"]["ErrorMessageDto"];
23044
+ };
23045
+ };
23046
+ /** @description Clone or GitHub App configuration failed */
23047
+ 503: {
23048
+ headers: {
23049
+ [name: string]: unknown;
23050
+ };
23051
+ content: {
23052
+ "application/json": components["schemas"]["ErrorMessageDto"];
23053
+ };
23054
+ };
23055
+ };
23056
+ };
23057
+ postRulesSkillsPullRequest: {
23058
+ parameters: {
23059
+ query?: never;
23060
+ header?: never;
23061
+ path: {
23062
+ workspaceId: components["parameters"]["WorkspaceId"];
23063
+ };
23064
+ cookie?: never;
23065
+ };
23066
+ requestBody: {
23067
+ content: {
23068
+ "application/json": components["schemas"]["RulesSkillsOpenPullRequestRequestDto"];
23069
+ };
23070
+ };
23071
+ responses: {
23072
+ /** @description Pull request created */
23073
+ 200: {
23074
+ headers: {
23075
+ [name: string]: unknown;
23076
+ };
23077
+ content: {
23078
+ "application/json": components["schemas"]["RulesSkillsOpenPullRequestResponseDto"];
23079
+ };
23080
+ };
23081
+ /** @description Missing proposed files or invalid body (`code: proposed_files_required`). */
23082
+ 400: {
23083
+ headers: {
23084
+ [name: string]: unknown;
23085
+ };
23086
+ content: {
23087
+ "application/json": components["schemas"]["ErrorMessageDto"];
23088
+ };
23089
+ };
23090
+ 401: components["responses"]["Unauthorized"];
23091
+ 403: components["responses"]["Forbidden"];
23092
+ /** @description Workspace or repository not found */
23093
+ 404: {
23094
+ headers: {
23095
+ [name: string]: unknown;
23096
+ };
23097
+ content: {
23098
+ "application/json": components["schemas"]["ErrorMessageDto"];
23099
+ };
23100
+ };
23101
+ /** @description GitHub installation lacks write permissions required for automated PRs */
23102
+ 422: {
23103
+ headers: {
23104
+ [name: string]: unknown;
23105
+ };
23106
+ content: {
23107
+ "application/json": components["schemas"]["GithubWritePermissionsRequiredErrorDto"];
23108
+ };
23109
+ };
23110
+ /** @description GitHub installation permissions could not be verified, or PR create failed */
23111
+ 503: {
23112
+ headers: {
23113
+ [name: string]: unknown;
23114
+ };
23115
+ content: {
23116
+ "application/json": components["schemas"]["GithubPermissionsCheckFailedErrorDto"] | components["schemas"]["ErrorMessageDto"];
23117
+ };
23118
+ };
23119
+ };
23120
+ };
22829
23121
  getReadinessIssueFixGuide: {
22830
23122
  parameters: {
22831
23123
  query?: never;