@thinkai/tai-api-contract 2.31.0-pr.731.2 → 2.32.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.
@@ -1,7 +1,7 @@
1
1
  openapi: 3.0.3
2
2
  info:
3
3
  title: ThinkAI API
4
- version: 2.31.0
4
+ version: 2.30.1
5
5
  description: >
6
6
  Contract surface for the AI Driven SDLC backend used by ThinkAI.
7
7
  Workspace-scoped routes use `/workspaces/{workspaceId}/...`.
@@ -2972,7 +2972,7 @@ paths:
2972
2972
  tags: [RepositoryReadiness]
2973
2973
  summary: Single repo readiness
2974
2974
  description: >
2975
- Returns one stored repository scorecard with all eight dimensions, nested issues,
2975
+ Returns one stored repository scorecard with all nine dimensions, nested issues,
2976
2976
  and per-dimension criteria detail breakdown (criteriaDetails required on each dimension).
2977
2977
  Unknown `repoId` or a repo that belongs to another workspace returns `404` (no cross-tenant leakage).
2978
2978
  operationId: getReadinessRepo
@@ -3213,25 +3213,6 @@ paths:
3213
3213
  - $ref: "#/components/parameters/PaginationLimit"
3214
3214
  - $ref: "#/components/parameters/PaginationOffset"
3215
3215
  - $ref: "#/components/parameters/PaginationOrder"
3216
- - name: sort
3217
- in: query
3218
- required: false
3219
- description: >
3220
- Server-side sort column (the activity "5 W's"). Combined with `order` (asc/desc).
3221
- Defaults to `when` (occurredAt). `occurredAt`/`id` is always the tiebreaker.
3222
- schema:
3223
- type: string
3224
- enum: [when, who, what, why, where]
3225
- - name: productArea
3226
- in: query
3227
- required: false
3228
- description: >
3229
- Coarse product-area grouping filter (#156). `integration` = GitHub + AI-tool key events;
3230
- `agentic_foundation` = repos, readiness scans, fixes; `workspace_team` = members + HRIS.
3231
- Omit (or pass `all`) for every area.
3232
- schema:
3233
- type: string
3234
- enum: [integration, agentic_foundation, workspace_team, all]
3235
3216
  - name: eventType
3236
3217
  in: query
3237
3218
  description: Filter to a specific event type.
@@ -3697,6 +3678,46 @@ paths:
3697
3678
  schema:
3698
3679
  $ref: "#/components/schemas/ErrorMessageDto"
3699
3680
 
3681
+ /workspaces/{workspaceId}/agentic-foundation/token-efficiency:
3682
+ get:
3683
+ tags: [AgenticFoundation]
3684
+ summary: Token Efficiency pillar (token-efficiency slice)
3685
+ description: >
3686
+ Returns `RepoReadinessScoreDetailDto` rows with only the `token-efficiency` dimension
3687
+ populated per repo, including criteriaDetails for that dimension (rubric Section I).
3688
+ operationId: getAgenticFoundationTokenEfficiency
3689
+ parameters:
3690
+ - $ref: "#/components/parameters/WorkspaceId"
3691
+ - $ref: "#/components/parameters/PaginationLimit"
3692
+ - $ref: "#/components/parameters/PaginationOffset"
3693
+ - $ref: "#/components/parameters/ReadinessRepoSort"
3694
+ - $ref: "#/components/parameters/PaginationOrder"
3695
+ - $ref: "#/components/parameters/ReadinessRepoSearch"
3696
+ - $ref: "#/components/parameters/ReadinessRepoLanguage"
3697
+ responses:
3698
+ "200":
3699
+ description: Paginated repositories with token-efficiency slice and criteriaDetails
3700
+ content:
3701
+ application/json:
3702
+ schema:
3703
+ $ref: "#/components/schemas/ReadinessRepoDetailListDto"
3704
+ "400":
3705
+ description: Invalid pagination or sort query
3706
+ content:
3707
+ application/json:
3708
+ schema:
3709
+ $ref: "#/components/schemas/ErrorMessageDto"
3710
+ "401":
3711
+ $ref: "#/components/responses/Unauthorized"
3712
+ "403":
3713
+ $ref: "#/components/responses/Forbidden"
3714
+ "404":
3715
+ description: Workspace does not exist
3716
+ content:
3717
+ application/json:
3718
+ schema:
3719
+ $ref: "#/components/schemas/ErrorMessageDto"
3720
+
3700
3721
  /workspaces/{workspaceId}/agentic-foundation/delivery-governance:
3701
3722
  get:
3702
3723
  tags: [AgenticFoundation]
@@ -4022,79 +4043,6 @@ paths:
4022
4043
  "403":
4023
4044
  $ref: "#/components/responses/Forbidden"
4024
4045
 
4025
- /workspaces/{workspaceId}/repo-eligibility:
4026
- get:
4027
- tags: [RepositoryReadiness]
4028
- summary: Get repo-sync eligibility gate (defaults + per-workspace overrides)
4029
- description: >
4030
- Returns the effective repo-sync eligibility gate (archived / fork / size / count) for the
4031
- workspace: the global `defaults`, any per-workspace `overrides`, the merged `effective`
4032
- values, and whether the caller can edit without platform-admin (`canEditUnrestricted`).
4033
- Member-level read access.
4034
- operationId: getWorkspaceRepoEligibility
4035
- parameters:
4036
- - $ref: "#/components/parameters/WorkspaceId"
4037
- responses:
4038
- "200":
4039
- description: Effective repo-eligibility configuration
4040
- content:
4041
- application/json:
4042
- schema:
4043
- $ref: "#/components/schemas/WorkspaceRepoEligibilityDto"
4044
- "401":
4045
- $ref: "#/components/responses/Unauthorized"
4046
- "403":
4047
- $ref: "#/components/responses/Forbidden"
4048
- put:
4049
- tags: [RepositoryReadiness]
4050
- summary: Set per-workspace repo-sync eligibility overrides
4051
- description: >
4052
- Set (or clear, with an empty `overrides`) the per-workspace repo-sync eligibility overrides.
4053
- **Platform admins** may set any value (raise caps, `0` = unlimited, include archived/forks).
4054
- **Workspace admins** may only make the gate *more restrictive* than the platform defaults
4055
- (lower caps, exclude archived/forks) — exceeding a platform limit returns `403`
4056
- (`repo_eligibility_bound_exceeded`). Requires workspace admin or platform admin.
4057
- operationId: putWorkspaceRepoEligibility
4058
- parameters:
4059
- - $ref: "#/components/parameters/WorkspaceId"
4060
- requestBody:
4061
- required: true
4062
- content:
4063
- application/json:
4064
- schema:
4065
- type: object
4066
- required: [overrides]
4067
- properties:
4068
- overrides:
4069
- $ref: "#/components/schemas/RepoEligibilityOverridesDto"
4070
- responses:
4071
- "200":
4072
- description: Overrides saved
4073
- content:
4074
- application/json:
4075
- schema:
4076
- type: object
4077
- required: [overrides, effective]
4078
- properties:
4079
- overrides:
4080
- $ref: "#/components/schemas/RepoEligibilityOverridesDto"
4081
- effective:
4082
- $ref: "#/components/schemas/RepoEligibilityConfigDto"
4083
- "400":
4084
- description: Invalid request body
4085
- content:
4086
- application/json:
4087
- schema:
4088
- $ref: "#/components/schemas/ErrorMessageDto"
4089
- "401":
4090
- $ref: "#/components/responses/Unauthorized"
4091
- "403":
4092
- description: Forbidden, or a workspace-admin value exceeds a platform limit (`repo_eligibility_bound_exceeded`)
4093
- content:
4094
- application/json:
4095
- schema:
4096
- $ref: "#/components/schemas/ErrorMessageDto"
4097
-
4098
4046
  /workspaces/{workspaceId}/readiness/cursor-key-usage:
4099
4047
  get:
4100
4048
  tags: [RepositoryReadiness]
@@ -5430,6 +5378,18 @@ components:
5430
5378
  Whether the Claude Code execution key is stored. If false and `claudePlatformKeyEnabled`
5431
5379
  is true in `WorkspaceConfigDto`, the platform key will be used for readiness runs
5432
5380
  (additional cost applies).
5381
+ insightsCredentialKind:
5382
+ type: string
5383
+ enum: [admin, analytics, unknown]
5384
+ description: >
5385
+ Kind of stored insights credential (derived from the active plan's key). `admin` for
5386
+ Team Console Admin keys (`sk-ant-admin…`); `analytics` for Enterprise Analytics keys.
5387
+ insightsTokenHint:
5388
+ type: string
5389
+ maxLength: 64
5390
+ description: >
5391
+ Masked preview of the stored insights key (prefix + last four characters). Never
5392
+ includes the full secret.
5433
5393
 
5434
5394
  AgentExecutionProviderDto:
5435
5395
  type: string
@@ -6796,123 +6756,6 @@ components:
6796
6756
  format: date-time
6797
6757
  nullable: true
6798
6758
  description: Last push or metadata update from GitHub when available.
6799
- archived:
6800
- type: boolean
6801
- nullable: true
6802
- description: True when the repository is archived (read-only on GitHub).
6803
- fork:
6804
- type: boolean
6805
- nullable: true
6806
- description: True when the repository is a fork of another repository.
6807
- disabled:
6808
- type: boolean
6809
- nullable: true
6810
- description: True when the repository is disabled on GitHub.
6811
- size:
6812
- type: integer
6813
- nullable: true
6814
- description: Repository size in KB as reported by GitHub.
6815
- readOnly:
6816
- type: boolean
6817
- nullable: true
6818
- description: >
6819
- True when the GitHub App installation lacks push access to this repo
6820
- (read-only). Read-only repos are rejected during sync because readiness
6821
- fixes require write access.
6822
- ineligibleReason:
6823
- type: string
6824
- nullable: true
6825
- description: >
6826
- Set when this repo was skipped during sync due to an eligibility check.
6827
- The frontend should display this as an inline explanation (e.g. "This repo is archived").
6828
- eligibilityStatus:
6829
- type: string
6830
- enum: [eligible, ineligible]
6831
- nullable: true
6832
- description: >
6833
- Language-based eligibility for Agentic-Foundation readiness analysis (issue #44).
6834
- `ineligible` repos (no supported stack) render read-only/orange in the AF list with
6835
- no analyze/score/fix actions. Mixed monorepos with a supported secondary stack are
6836
- `eligible`. Distinct from `ineligibleReason`, which reflects the structural sync gate.
6837
- eligibilityReason:
6838
- type: string
6839
- nullable: true
6840
- description: >
6841
- Human-readable explanation when `eligibilityStatus` is `ineligible`
6842
- (e.g. "This repository's primary language (Python) is not supported in v1").
6843
- primaryStack:
6844
- type: string
6845
- nullable: true
6846
- description: >
6847
- Dominant supported stack (by GitHub language bytes), one of
6848
- backend_jvm | ios_app | web_spa | backend_go | backend_python. Null for ineligible repos.
6849
- secondaryStack:
6850
- type: string
6851
- nullable: true
6852
- description: Second supported stack for a multi-stack repo, or null.
6853
- supportedStacks:
6854
- type: array
6855
- nullable: true
6856
- items:
6857
- type: string
6858
- description: >
6859
- All supported stacks detected for the repo (ordered, primary first). Empty/null
6860
- when no supported stack is present. Drives multi-stack scanning and the orange
6861
- mixed-monorepo box in the AF UI.
6862
-
6863
- RepoEligibilityConfigDto:
6864
- type: object
6865
- description: Resolved repo-sync eligibility gate (defaults or effective). All fields present.
6866
- required: [excludeArchived, excludeForks, maxRepoSizeKb, maxReposPerWorkspace]
6867
- properties:
6868
- excludeArchived:
6869
- type: boolean
6870
- description: Skip archived repos during GitHub repo sync.
6871
- excludeForks:
6872
- type: boolean
6873
- description: Skip forked repos. Forks are included by default.
6874
- maxRepoSizeKb:
6875
- type: integer
6876
- description: Max repo size in KB (GitHub-reported). 0 = no limit.
6877
- maxReposPerWorkspace:
6878
- type: integer
6879
- description: Max repos materialized per workspace per sync. 0 = no limit.
6880
-
6881
- RepoEligibilityOverridesDto:
6882
- type: object
6883
- additionalProperties: false
6884
- description: >
6885
- Per-workspace overrides for the repo-sync eligibility gate. Any field present wins over the
6886
- global default; omit a field to inherit the default. An empty object clears all overrides.
6887
- properties:
6888
- excludeArchived:
6889
- type: boolean
6890
- nullable: true
6891
- excludeForks:
6892
- type: boolean
6893
- nullable: true
6894
- maxRepoSizeKb:
6895
- type: integer
6896
- minimum: 0
6897
- nullable: true
6898
- maxReposPerWorkspace:
6899
- type: integer
6900
- minimum: 0
6901
- nullable: true
6902
-
6903
- WorkspaceRepoEligibilityDto:
6904
- type: object
6905
- required: [defaults, overrides, effective, canEditUnrestricted]
6906
- properties:
6907
- defaults:
6908
- $ref: "#/components/schemas/RepoEligibilityConfigDto"
6909
- overrides:
6910
- $ref: "#/components/schemas/RepoEligibilityOverridesDto"
6911
- effective:
6912
- $ref: "#/components/schemas/RepoEligibilityConfigDto"
6913
- canEditUnrestricted:
6914
- type: boolean
6915
- description: True when the caller is a platform admin (may set any value, incl. raising caps).
6916
6759
 
6917
6760
  GithubMissingPermissionDto:
6918
6761
  type: object
@@ -7450,6 +7293,7 @@ components:
7450
7293
  description: Workspace readiness scoring dimension
7451
7294
  enum:
7452
7295
  - ai-agent-readiness
7296
+ - token-efficiency
7453
7297
  - repo-hygiene
7454
7298
  - stack-quality
7455
7299
  - tests-qa
@@ -7940,33 +7784,6 @@ components:
7940
7784
  nullable: true
7941
7785
  enum: [github_removed, installation_disconnected, installation_replaced, superseded]
7942
7786
  description: Why the repo was archived. Only present when `archivedAt` is set.
7943
- eligibilityStatus:
7944
- type: string
7945
- enum: [eligible, ineligible]
7946
- nullable: true
7947
- description: >
7948
- Language-based eligibility for Agentic-Foundation analysis (#44). `ineligible` repos
7949
- (no v1-supported stack) render read-only/orange in the AF list with no analyze/score/fix
7950
- actions; the server also rejects analyze requests for them. Null until the first
7951
- sync/scan computes it.
7952
- eligibilityReason:
7953
- type: string
7954
- nullable: true
7955
- description: Human-readable explanation when `eligibilityStatus` is `ineligible`.
7956
- primaryStack:
7957
- type: string
7958
- nullable: true
7959
- description: Dominant supported stack — backend_jvm | ios_app | web_spa | backend_go | backend_python. Null when ineligible/uncomputed.
7960
- secondaryStack:
7961
- type: string
7962
- nullable: true
7963
- description: Second supported stack for a multi-stack repo, or null.
7964
- supportedStacks:
7965
- type: array
7966
- nullable: true
7967
- items:
7968
- type: string
7969
- description: All supported stacks detected (ordered, primary first). Empty/null when none.
7970
7787
 
7971
7788
  RepoReadinessScoreDetailDto:
7972
7789
  type: object
@@ -9041,29 +8858,18 @@ components:
9041
8858
  - readiness.scan_completed
9042
8859
  - readiness.scan_failed
9043
8860
  - readiness.scan_partial
9044
- - integrations.agent_execution.provider_changed
9045
- - integrations.repo_eligibility.overrides_changed
9046
- - integrations.cursor.platform_key_enabled
9047
- - integrations.cursor.platform_key_disabled
8861
+ - config.cursor.added
8862
+ - config.cursor.updated
8863
+ - config.cursor.removed
8864
+ - config.cursor.platform_key_enabled
8865
+ - config.cursor.platform_key_disabled
8866
+ - config.claude.added
8867
+ - config.claude.updated
8868
+ - config.claude.removed
8869
+ - config.agent_execution.provider_changed
9048
8870
  - member.invited
9049
8871
  - member.role_changed
9050
8872
  - member.removed
9051
- - repo.sync_skipped
9052
- - integrations.cursor.execution_key.added
9053
- - integrations.cursor.execution_key.updated
9054
- - integrations.cursor.execution_key.removed
9055
- - integrations.cursor.execution_key.check_failed
9056
- - integrations.cursor.admin_key.added
9057
- - integrations.cursor.admin_key.updated
9058
- - integrations.cursor.admin_key.removed
9059
- - integrations.claude.execution_key.added
9060
- - integrations.claude.execution_key.updated
9061
- - integrations.claude.execution_key.removed
9062
- - integrations.claude.execution_key.check_failed
9063
- - integrations.claude.admin_key.added
9064
- - integrations.claude.admin_key.updated
9065
- - integrations.claude.admin_key.removed
9066
- - readiness.scan_precheck_failed
9067
8873
 
9068
8874
  ActivityLogActorDto:
9069
8875
  type: object
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thinkai/tai-api-contract",
3
- "version": "2.31.0-pr.731.2",
3
+ "version": "2.32.0",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "dist/index.js",