@thinkai/tai-api-contract 2.33.1-pr.731.7 → 2.34.0-pr.810.1

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.33.1
4
+ version: 2.34.0
5
5
  description: >
6
6
  Contract surface for the AI Driven SDLC backend used by ThinkAI.
7
7
  Workspace-scoped routes use `/workspaces/{workspaceId}/...`.
@@ -46,6 +46,8 @@ tags:
46
46
  description: Authenticated user profile (§11)
47
47
  - name: Preferences
48
48
  description: Per-user per-workspace preferences (§12)
49
+ - name: Consent
50
+ description: Per-user cookie and browser-storage consent records (GDPR Art. 7 / UAE PDPL)
49
51
  - name: OrgChartImport
50
52
  description: Org chart import via storage path (§14)
51
53
  - name: AgenticFoundation
@@ -3213,25 +3215,6 @@ paths:
3213
3215
  - $ref: "#/components/parameters/PaginationLimit"
3214
3216
  - $ref: "#/components/parameters/PaginationOffset"
3215
3217
  - $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
- `productivity` = productivity ingest lifecycle events. Omit (or pass `all`) for every area.
3232
- schema:
3233
- type: string
3234
- enum: [integration, agentic_foundation, workspace_team, productivity, all]
3235
3218
  - name: eventType
3236
3219
  in: query
3237
3220
  description: Filter to a specific event type.
@@ -4062,79 +4045,6 @@ paths:
4062
4045
  "403":
4063
4046
  $ref: "#/components/responses/Forbidden"
4064
4047
 
4065
- /workspaces/{workspaceId}/repo-eligibility:
4066
- get:
4067
- tags: [RepositoryReadiness]
4068
- summary: Get repo-sync eligibility gate (defaults + per-workspace overrides)
4069
- description: >
4070
- Returns the effective repo-sync eligibility gate (archived / fork / size / count) for the
4071
- workspace: the global `defaults`, any per-workspace `overrides`, the merged `effective`
4072
- values, and whether the caller can edit without platform-admin (`canEditUnrestricted`).
4073
- Member-level read access.
4074
- operationId: getWorkspaceRepoEligibility
4075
- parameters:
4076
- - $ref: "#/components/parameters/WorkspaceId"
4077
- responses:
4078
- "200":
4079
- description: Effective repo-eligibility configuration
4080
- content:
4081
- application/json:
4082
- schema:
4083
- $ref: "#/components/schemas/WorkspaceRepoEligibilityDto"
4084
- "401":
4085
- $ref: "#/components/responses/Unauthorized"
4086
- "403":
4087
- $ref: "#/components/responses/Forbidden"
4088
- put:
4089
- tags: [RepositoryReadiness]
4090
- summary: Set per-workspace repo-sync eligibility overrides
4091
- description: >
4092
- Set (or clear, with an empty `overrides`) the per-workspace repo-sync eligibility overrides.
4093
- **Platform admins** may set any value (raise caps, `0` = unlimited, include archived/forks).
4094
- **Workspace admins** may only make the gate *more restrictive* than the platform defaults
4095
- (lower caps, exclude archived/forks) — exceeding a platform limit returns `403`
4096
- (`repo_eligibility_bound_exceeded`). Requires workspace admin or platform admin.
4097
- operationId: putWorkspaceRepoEligibility
4098
- parameters:
4099
- - $ref: "#/components/parameters/WorkspaceId"
4100
- requestBody:
4101
- required: true
4102
- content:
4103
- application/json:
4104
- schema:
4105
- type: object
4106
- required: [overrides]
4107
- properties:
4108
- overrides:
4109
- $ref: "#/components/schemas/RepoEligibilityOverridesDto"
4110
- responses:
4111
- "200":
4112
- description: Overrides saved
4113
- content:
4114
- application/json:
4115
- schema:
4116
- type: object
4117
- required: [overrides, effective]
4118
- properties:
4119
- overrides:
4120
- $ref: "#/components/schemas/RepoEligibilityOverridesDto"
4121
- effective:
4122
- $ref: "#/components/schemas/RepoEligibilityConfigDto"
4123
- "400":
4124
- description: Invalid request body
4125
- content:
4126
- application/json:
4127
- schema:
4128
- $ref: "#/components/schemas/ErrorMessageDto"
4129
- "401":
4130
- $ref: "#/components/responses/Unauthorized"
4131
- "403":
4132
- description: Forbidden, or a workspace-admin value exceeds a platform limit (`repo_eligibility_bound_exceeded`)
4133
- content:
4134
- application/json:
4135
- schema:
4136
- $ref: "#/components/schemas/ErrorMessageDto"
4137
-
4138
4048
  /workspaces/{workspaceId}/readiness/cursor-key-usage:
4139
4049
  get:
4140
4050
  tags: [RepositoryReadiness]
@@ -4437,6 +4347,52 @@ paths:
4437
4347
  "401":
4438
4348
  $ref: "#/components/responses/Unauthorized"
4439
4349
 
4350
+ /me/consent:
4351
+ get:
4352
+ tags: [Consent]
4353
+ summary: Get cookie/storage consent for current user
4354
+ operationId: getMyConsent
4355
+ responses:
4356
+ "200":
4357
+ description: Consent record
4358
+ content:
4359
+ application/json:
4360
+ schema:
4361
+ $ref: "#/components/schemas/ConsentRecordDto"
4362
+ "401":
4363
+ $ref: "#/components/responses/Unauthorized"
4364
+ "404":
4365
+ description: No consent record stored yet
4366
+ content:
4367
+ application/json:
4368
+ schema:
4369
+ $ref: "#/components/schemas/ErrorMessageDto"
4370
+ put:
4371
+ tags: [Consent]
4372
+ summary: Upsert cookie/storage consent
4373
+ operationId: putMyConsent
4374
+ requestBody:
4375
+ required: true
4376
+ content:
4377
+ application/json:
4378
+ schema:
4379
+ $ref: "#/components/schemas/PutConsentBodyDto"
4380
+ responses:
4381
+ "200":
4382
+ description: Saved consent record
4383
+ content:
4384
+ application/json:
4385
+ schema:
4386
+ $ref: "#/components/schemas/ConsentRecordDto"
4387
+ "400":
4388
+ description: Validation failed
4389
+ content:
4390
+ application/json:
4391
+ schema:
4392
+ $ref: "#/components/schemas/ConsentValidationErrorDto"
4393
+ "401":
4394
+ $ref: "#/components/responses/Unauthorized"
4395
+
4440
4396
  /workspaces/{workspaceId}/org-chart/import:
4441
4397
  post:
4442
4398
  tags: [OrgChartImport]
@@ -5776,6 +5732,16 @@ components:
5776
5732
  type: number
5777
5733
  failRatePercent:
5778
5734
  type: number
5735
+ description: DORA change failure rate (deployments/incidents), not CI build failures.
5736
+ ciFailRatePercent:
5737
+ type: number
5738
+ description: >
5739
+ GitHub Actions / Checks CI build failure rate for the week bucket
5740
+ (failed runs / (failed + passed) * 100). Zero when GitHub Actions CI is disabled.
5741
+ ciBuildFailuresCount:
5742
+ type: integer
5743
+ minimum: 0
5744
+ description: Count of build.failed events in the week bucket when CI ingest is enabled.
5779
5745
  avgReviewWaitHours:
5780
5746
  type: number
5781
5747
  description: Mean hours from PR creation to first review in this week bucket.
@@ -5835,6 +5801,9 @@ components:
5835
5801
  generatedAt:
5836
5802
  type: string
5837
5803
  format: date-time
5804
+ githubActionsCiEnabled:
5805
+ type: boolean
5806
+ description: True when the workspace has opted in to GitHub Actions CI ingest.
5838
5807
  teams:
5839
5808
  type: array
5840
5809
  items:
@@ -5928,6 +5897,9 @@ components:
5928
5897
  avgFailRatePercent:
5929
5898
  type: number
5930
5899
  description: Average change failure rate over the range when available.
5900
+ avgCiFailRatePercent:
5901
+ type: number
5902
+ description: Average GitHub Actions CI build failure rate over the range when CI ingest is enabled.
5931
5903
 
5932
5904
  ProductivityInsightsTeamSummaryDto:
5933
5905
  type: object
@@ -5940,6 +5912,10 @@ components:
5940
5912
  type: number
5941
5913
  avgFailRatePercent:
5942
5914
  type: number
5915
+ description: Average DORA change failure rate over the range when available.
5916
+ avgCiFailRatePercent:
5917
+ type: number
5918
+ description: Average GitHub Actions CI build failure rate over the range when CI ingest is enabled.
5943
5919
  headcount:
5944
5920
  type: integer
5945
5921
  minimum: 0
@@ -6000,6 +5976,9 @@ components:
6000
5976
  generatedAt:
6001
5977
  type: string
6002
5978
  format: date-time
5979
+ githubActionsCiEnabled:
5980
+ type: boolean
5981
+ description: True when the workspace has opted in to GitHub Actions CI ingest.
6003
5982
  items:
6004
5983
  type: array
6005
5984
  description: Present when `teamId` query is omitted — top-ranked teams.
@@ -6121,6 +6100,10 @@ components:
6121
6100
  minimum: 0
6122
6101
  avgFailRate:
6123
6102
  type: number
6103
+ description: Average DORA change failure rate over the range when available.
6104
+ avgCiFailRate:
6105
+ type: number
6106
+ description: Average GitHub Actions CI build failure rate over the range when CI ingest is enabled.
6124
6107
  mergedPrDelta:
6125
6108
  type: number
6126
6109
  avgMergedPrsPerWeekDelta:
@@ -6129,6 +6112,9 @@ components:
6129
6112
  type: number
6130
6113
  avgFailRateDelta:
6131
6114
  type: number
6115
+ avgCiFailRateDelta:
6116
+ type: number
6117
+ description: Change in average CI build failure rate vs the prior comparison window.
6132
6118
 
6133
6119
  ProductivityInsightsContributorDetailDto:
6134
6120
  type: object
@@ -6160,6 +6146,9 @@ components:
6160
6146
  generatedAt:
6161
6147
  type: string
6162
6148
  format: date-time
6149
+ githubActionsCiEnabled:
6150
+ type: boolean
6151
+ description: True when the workspace has opted in to GitHub Actions CI ingest.
6163
6152
  contributor:
6164
6153
  $ref: "#/components/schemas/ProductivityInsightsContributorProfileDto"
6165
6154
  weeks:
@@ -6196,6 +6185,9 @@ components:
6196
6185
  avgFailRatePercent:
6197
6186
  type: number
6198
6187
  description: Mean weekly change-failure rate when available.
6188
+ avgCiFailRatePercent:
6189
+ type: number
6190
+ description: Mean weekly GitHub Actions CI build failure rate when CI ingest is enabled.
6199
6191
 
6200
6192
  ProductivityInsightsNeedsAttentionDto:
6201
6193
  type: object
@@ -6215,6 +6207,9 @@ components:
6215
6207
  generatedAt:
6216
6208
  type: string
6217
6209
  format: date-time
6210
+ githubActionsCiEnabled:
6211
+ type: boolean
6212
+ description: True when GitHub Actions CI ingest is enabled for this workspace.
6218
6213
  items:
6219
6214
  type: array
6220
6215
  items:
@@ -6848,119 +6843,6 @@ components:
6848
6843
  format: date-time
6849
6844
  nullable: true
6850
6845
  description: Last push or metadata update from GitHub when available.
6851
- archived:
6852
- type: boolean
6853
- nullable: true
6854
- description: True when the repository is archived (read-only on GitHub).
6855
- fork:
6856
- type: boolean
6857
- nullable: true
6858
- description: True when the repository is a fork of another repository.
6859
- disabled:
6860
- type: boolean
6861
- nullable: true
6862
- description: True when the repository is disabled on GitHub.
6863
- size:
6864
- type: integer
6865
- nullable: true
6866
- description: Repository size in KB as reported by GitHub.
6867
- ineligibleReasons:
6868
- type: array
6869
- nullable: true
6870
- items:
6871
- type: string
6872
- description: >
6873
- All reasons this repo was skipped during sync or is ineligible for analysis.
6874
- Each entry is a human-readable explanation (e.g. "This repo is archived").
6875
- Empty or absent means the repo passed all checks.
6876
- eligibilityStatus:
6877
- type: string
6878
- enum: [eligible, ineligible]
6879
- nullable: true
6880
- description: >
6881
- Language-based eligibility for Agentic-Foundation readiness analysis (issue #44).
6882
- `ineligible` repos (no supported stack) render read-only/orange in the AF list with
6883
- no analyze/score/fix actions. Mixed monorepos with a supported secondary stack are
6884
- `eligible`. Distinct from `ineligibleReasons`, which reflects structural sync gates.
6885
- eligibilityReason:
6886
- type: string
6887
- nullable: true
6888
- description: >
6889
- Human-readable explanation when `eligibilityStatus` is `ineligible`
6890
- (e.g. "This repository's primary language (Python) is not supported in v1").
6891
- primaryStack:
6892
- type: string
6893
- nullable: true
6894
- description: >
6895
- Dominant supported stack (by GitHub language bytes), one of
6896
- backend_jvm | ios_app | web_spa | backend_go | backend_python. Null for ineligible repos.
6897
- secondaryStack:
6898
- type: string
6899
- nullable: true
6900
- description: Second supported stack for a multi-stack repo, or null.
6901
- supportedStacks:
6902
- type: array
6903
- nullable: true
6904
- items:
6905
- type: string
6906
- description: >
6907
- All supported stacks detected for the repo (ordered, primary first). Empty/null
6908
- when no supported stack is present. Drives multi-stack scanning and the orange
6909
- mixed-monorepo box in the AF UI.
6910
-
6911
- RepoEligibilityConfigDto:
6912
- type: object
6913
- description: Resolved repo-sync eligibility gate (defaults or effective). All fields present.
6914
- required: [excludeArchived, excludeForks, maxRepoSizeKb, maxReposPerWorkspace]
6915
- properties:
6916
- excludeArchived:
6917
- type: boolean
6918
- description: Skip archived repos during GitHub repo sync.
6919
- excludeForks:
6920
- type: boolean
6921
- description: Skip forked repos. Forks are included by default.
6922
- maxRepoSizeKb:
6923
- type: integer
6924
- description: Max repo size in KB (GitHub-reported). 0 = no limit.
6925
- maxReposPerWorkspace:
6926
- type: integer
6927
- description: Max repos materialized per workspace per sync. 0 = no limit.
6928
-
6929
- RepoEligibilityOverridesDto:
6930
- type: object
6931
- additionalProperties: false
6932
- description: >
6933
- Per-workspace overrides for the repo-sync eligibility gate. Any field present wins over the
6934
- global default; omit a field to inherit the default. An empty object clears all overrides.
6935
- properties:
6936
- excludeArchived:
6937
- type: boolean
6938
- nullable: true
6939
- excludeForks:
6940
- type: boolean
6941
- nullable: true
6942
- maxRepoSizeKb:
6943
- type: integer
6944
- minimum: 0
6945
- nullable: true
6946
- maxReposPerWorkspace:
6947
- type: integer
6948
- minimum: 0
6949
- nullable: true
6950
-
6951
- WorkspaceRepoEligibilityDto:
6952
- type: object
6953
- required: [defaults, overrides, effective, canEditUnrestricted]
6954
- properties:
6955
- defaults:
6956
- $ref: "#/components/schemas/RepoEligibilityConfigDto"
6957
- overrides:
6958
- $ref: "#/components/schemas/RepoEligibilityOverridesDto"
6959
- effective:
6960
- $ref: "#/components/schemas/RepoEligibilityConfigDto"
6961
- canEditUnrestricted:
6962
- type: boolean
6963
- description: True when the caller is a platform admin (may set any value, incl. raising caps).
6964
6846
 
6965
6847
  GithubMissingPermissionDto:
6966
6848
  type: object
@@ -7803,8 +7685,10 @@ components:
7803
7685
  type: array
7804
7686
  description: >
7805
7687
  Individual rubric criterion outcomes from the latest successful scan.
7806
- Always present on the single-repo detail endpoint; empty array when no
7807
- scan has completed yet for this dimension.
7688
+ Always present on the single-repo detail endpoint. When the repo has a
7689
+ succeeded scan but a dimension was not evaluated (e.g. Section I on older
7690
+ runs), the API returns full rubric placeholders with status `blocked`.
7691
+ Empty array only when the repo has no succeeded scan yet.
7808
7692
  items:
7809
7693
  $ref: "#/components/schemas/CriterionDetailDto"
7810
7694
  issues:
@@ -7989,33 +7873,6 @@ components:
7989
7873
  nullable: true
7990
7874
  enum: [github_removed, installation_disconnected, installation_replaced, superseded]
7991
7875
  description: Why the repo was archived. Only present when `archivedAt` is set.
7992
- eligibilityStatus:
7993
- type: string
7994
- enum: [eligible, ineligible]
7995
- nullable: true
7996
- description: >
7997
- Language-based eligibility for Agentic-Foundation analysis (#44). `ineligible` repos
7998
- (no v1-supported stack) render read-only/orange in the AF list with no analyze/score/fix
7999
- actions; the server also rejects analyze requests for them. Null until the first
8000
- sync/scan computes it.
8001
- eligibilityReason:
8002
- type: string
8003
- nullable: true
8004
- description: Human-readable explanation when `eligibilityStatus` is `ineligible`.
8005
- primaryStack:
8006
- type: string
8007
- nullable: true
8008
- description: Dominant supported stack — backend_jvm | ios_app | web_spa | backend_go | backend_python. Null when ineligible/uncomputed.
8009
- secondaryStack:
8010
- type: string
8011
- nullable: true
8012
- description: Second supported stack for a multi-stack repo, or null.
8013
- supportedStacks:
8014
- type: array
8015
- nullable: true
8016
- items:
8017
- type: string
8018
- description: All supported stacks detected (ordered, primary first). Empty/null when none.
8019
7876
 
8020
7877
  RepoReadinessScoreDetailDto:
8021
7878
  type: object
@@ -8816,6 +8673,62 @@ components:
8816
8673
  nullable: true
8817
8674
  description: Temporary backward-compatibility alias (e.g. "Invalid timezone").
8818
8675
 
8676
+ ConsentCategoriesDto:
8677
+ type: object
8678
+ additionalProperties: false
8679
+ required: [functional, analytics, marketing]
8680
+ properties:
8681
+ functional:
8682
+ type: boolean
8683
+ description: Functional storage (preferences, onboarding, UI state).
8684
+ analytics:
8685
+ type: boolean
8686
+ description: Analytics and product telemetry in the browser.
8687
+ marketing:
8688
+ type: boolean
8689
+ description: Advertising and remarketing tags.
8690
+
8691
+ PutConsentBodyDto:
8692
+ type: object
8693
+ additionalProperties: false
8694
+ required: [policyVersion, categories]
8695
+ properties:
8696
+ policyVersion:
8697
+ type: string
8698
+ description: Cookie policy version the user consented to.
8699
+ maxLength: 64
8700
+ categories:
8701
+ $ref: "#/components/schemas/ConsentCategoriesDto"
8702
+
8703
+ ConsentRecordDto:
8704
+ type: object
8705
+ additionalProperties: false
8706
+ required: [policyVersion, categories, recordedAt]
8707
+ properties:
8708
+ policyVersion:
8709
+ type: string
8710
+ categories:
8711
+ $ref: "#/components/schemas/ConsentCategoriesDto"
8712
+ recordedAt:
8713
+ type: string
8714
+ format: date-time
8715
+ description: When consent was last recorded (UTC).
8716
+
8717
+ ConsentValidationErrorDto:
8718
+ type: object
8719
+ required: [error, issues]
8720
+ properties:
8721
+ error:
8722
+ type: string
8723
+ enum: [ValidationError]
8724
+ issues:
8725
+ type: array
8726
+ items:
8727
+ $ref: "#/components/schemas/ValidationIssueDto"
8728
+ legacyError:
8729
+ type: string
8730
+ nullable: true
8731
+
8819
8732
  OrgChartImportBodyDto:
8820
8733
  type: object
8821
8734
  additionalProperties: false
@@ -9090,32 +9003,18 @@ components:
9090
9003
  - readiness.scan_completed
9091
9004
  - readiness.scan_failed
9092
9005
  - readiness.scan_partial
9093
- - integrations.agent_execution.provider_changed
9094
- - integrations.repo_eligibility.overrides_changed
9095
- - integrations.cursor.platform_key_enabled
9096
- - integrations.cursor.platform_key_disabled
9006
+ - config.cursor.added
9007
+ - config.cursor.updated
9008
+ - config.cursor.removed
9009
+ - config.cursor.platform_key_enabled
9010
+ - config.cursor.platform_key_disabled
9011
+ - config.claude.added
9012
+ - config.claude.updated
9013
+ - config.claude.removed
9014
+ - config.agent_execution.provider_changed
9097
9015
  - member.invited
9098
9016
  - member.role_changed
9099
9017
  - member.removed
9100
- - repo.sync_skipped
9101
- - integrations.cursor.execution_key.added
9102
- - integrations.cursor.execution_key.updated
9103
- - integrations.cursor.execution_key.removed
9104
- - integrations.cursor.execution_key.check_failed
9105
- - integrations.cursor.admin_key.added
9106
- - integrations.cursor.admin_key.updated
9107
- - integrations.cursor.admin_key.removed
9108
- - integrations.claude.execution_key.added
9109
- - integrations.claude.execution_key.updated
9110
- - integrations.claude.execution_key.removed
9111
- - integrations.claude.execution_key.check_failed
9112
- - integrations.claude.admin_key.added
9113
- - integrations.claude.admin_key.updated
9114
- - integrations.claude.admin_key.removed
9115
- - readiness.scan_precheck_failed
9116
- - productivity.ingest.completed
9117
- - productivity.ingest.failed
9118
- - productivity.ingest.skipped
9119
9018
 
9120
9019
  ActivityLogActorDto:
9121
9020
  type: object
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thinkai/tai-api-contract",
3
- "version": "2.33.1-pr.731.7",
3
+ "version": "2.34.0-pr.810.1",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "dist/index.js",