@thinkai/tai-api-contract 2.209.1 → 2.210.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.209.1
4
+ version: 2.210.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}/...`.
@@ -3198,6 +3198,7 @@ paths:
3198
3198
  - $ref: "#/components/schemas/IncidentIoSourceDto"
3199
3199
  - $ref: "#/components/schemas/SentrySourceDto"
3200
3200
  - $ref: "#/components/schemas/JiraSourceDto"
3201
+ - $ref: "#/components/schemas/LinearSourceDto"
3201
3202
  - $ref: "#/components/schemas/TenantSourceEntryDto"
3202
3203
  examples:
3203
3204
  cursorAndJira:
@@ -3219,6 +3220,13 @@ paths:
3219
3220
  baseUrl: https://jira.example.com
3220
3221
  email: u@example.com
3221
3222
  apiToken: token
3223
+ linearValid:
3224
+ summary: Linear source (personal API key, optional team filter)
3225
+ value:
3226
+ sources:
3227
+ - type: linear
3228
+ apiKey: lin_api_example
3229
+ teamKeys: ENG,OPS
3222
3230
  confluenceValid:
3223
3231
  summary: Confluence Cloud source
3224
3232
  value:
@@ -3295,6 +3303,13 @@ paths:
3295
3303
  `error` codes for AI tool verifiers: `invalid_token`, `rate_limited`, `network_error`.
3296
3304
  `jira` (`baseUrl`, `email`, `apiToken` or legacy `api_key`) calls
3297
3305
  `GET {baseUrl}/rest/api/3/myself` with Basic auth.
3306
+ `linear` (`apiKey`, optional `teamKeys`) queries `viewer` and `organization` on
3307
+ `https://api.linear.app/graphql` with the personal API key in `Authorization`. Success
3308
+ returns `orgName`, `workspaceUrl`, and `userName`. When `teamKeys` is set and none of the
3309
+ keys is visible to the key, the test still succeeds and returns
3310
+ `warning: "No teams matched <keys>"`. `apiKey: "***"` re-tests the stored key
3311
+ (connected-view "Test again"). A bad key returns
3312
+ `{ success: false, error: "Invalid Linear API key." }`.
3298
3313
 
3299
3314
  **Typical outcomes:** Malformed body, missing `type`, invalid `type`, or missing required fields for the
3300
3315
  declared type → `400` with `{ error: "..." }`. Well-formed body with bad credentials or unreachable
@@ -3322,6 +3337,7 @@ paths:
3322
3337
  - $ref: "#/components/schemas/IncidentIoSourceDto"
3323
3338
  - $ref: "#/components/schemas/SentrySourceDto"
3324
3339
  - $ref: "#/components/schemas/JiraSourceDto"
3340
+ - $ref: "#/components/schemas/LinearSourceDto"
3325
3341
  - $ref: "#/components/schemas/TenantSourceEntryDto"
3326
3342
  examples:
3327
3343
  cursorValid:
@@ -3353,6 +3369,12 @@ paths:
3353
3369
  apiKey: datadog_api_key_example
3354
3370
  appKey: datadog_app_key_example
3355
3371
  site: datadoghq.com
3372
+ linearValid:
3373
+ summary: Linear source for connection test
3374
+ value:
3375
+ type: linear
3376
+ apiKey: lin_api_example
3377
+ teamKeys: ENG
3356
3378
  githubShape:
3357
3379
  summary: GitHub-shaped body (non-AI-tool types return unsupported_type unless extended)
3358
3380
  value:
@@ -5792,6 +5814,41 @@ paths:
5792
5814
  schema:
5793
5815
  $ref: "#/components/schemas/ErrorMessageDto"
5794
5816
 
5817
+ /workspaces/{workspaceId}/integrations/github/recent-commit-authors:
5818
+ post:
5819
+ tags: [Integrations]
5820
+ summary: Default-branch commit authors for the GitHub contribution filter
5821
+ operationId: lookupGithubRecentCommitAuthors
5822
+ description: >
5823
+ Batched lookup of recent commits on each repository's default branch.
5824
+ Used when the GitHub repository filter excludes bots. A failed or incomplete
5825
+ repository stays `complete: false` so the client keeps the row. Known results
5826
+ are cached by installation, repository id, and window end.
5827
+ parameters:
5828
+ - $ref: "#/components/parameters/WorkspaceId"
5829
+ requestBody:
5830
+ required: true
5831
+ content:
5832
+ application/json:
5833
+ schema:
5834
+ $ref: "#/components/schemas/GithubRecentCommitAuthorsRequestDto"
5835
+ responses:
5836
+ "200":
5837
+ description: One result per requested repository
5838
+ content:
5839
+ application/json:
5840
+ schema:
5841
+ $ref: "#/components/schemas/GithubRecentCommitAuthorsResponseDto"
5842
+ "400":
5843
+ description: Invalid window or repository list
5844
+ content:
5845
+ application/json:
5846
+ schema:
5847
+ $ref: "#/components/schemas/ErrorMessageDto"
5848
+ "401":
5849
+ $ref: "#/components/responses/Unauthorized"
5850
+ "403":
5851
+ $ref: "#/components/responses/Forbidden"
5795
5852
  /workspaces/{workspaceId}/integrations/github:
5796
5853
  get:
5797
5854
  tags: [Integrations]
@@ -9162,8 +9219,10 @@ paths:
9162
9219
  summary: Update Agentic Foundation repository scope
9163
9220
  description: >
9164
9221
  Bulk include/exclude materialized repos from Agentic Foundation by toggling the existing
9165
- `user_removed` archive state. Excluded repos remain integrated for productivity metrics.
9166
- Only workspace admins may call this endpoint. Partial failures are reported per repo.
9222
+ `user_removed` archive state. Excluded (Inactive) repos stop being scanned and stay
9223
+ integrated for productivity and SDLC ingest, unless `excludeFromIngest` is true (the
9224
+ GitHub repository selection), which leaves them out of ingest too. Including a repo
9225
+ restores both. The GitHub App grant itself is unchanged. Only workspace admins may call this endpoint. Partial failures are reported per repo.
9167
9226
  operationId: putAgenticFoundationRepoScope
9168
9227
  parameters:
9169
9228
  - $ref: "#/components/parameters/WorkspaceId"
@@ -10241,6 +10300,60 @@ paths:
10241
10300
  "403":
10242
10301
  $ref: "#/components/responses/Forbidden"
10243
10302
 
10303
+ /workspaces/{workspaceId}/agent-execution-providers:
10304
+ put:
10305
+ tags: [RepositoryReadiness]
10306
+ summary: Save the ordered agent execution providers for this workspace
10307
+ description: >
10308
+ Saves the enabled agent execution providers in the order runs try them (#1006). Runs use
10309
+ the first provider; when it errors, is unavailable, or runs out of budget, they use the
10310
+ next one. At least one provider is required. `cursor_user_api_key` and `claude_api_key`
10311
+ need a saved execution key; `thinkai_platform_cursor` implies consent to platform-key
10312
+ billing. The first entry is mirrored into `agentExecutionProvider`. Requires workspace
10313
+ admin role.
10314
+ operationId: putAgentExecutionProviders
10315
+ parameters:
10316
+ - $ref: "#/components/parameters/WorkspaceId"
10317
+ requestBody:
10318
+ required: true
10319
+ content:
10320
+ application/json:
10321
+ schema:
10322
+ $ref: "#/components/schemas/PutAgentExecutionProvidersDto"
10323
+ responses:
10324
+ "200":
10325
+ description: Providers saved
10326
+ content:
10327
+ application/json:
10328
+ schema:
10329
+ type: object
10330
+ required: [ok, providers]
10331
+ properties:
10332
+ ok:
10333
+ type: boolean
10334
+ providers:
10335
+ type: array
10336
+ items:
10337
+ $ref: "#/components/schemas/AgentExecutionProviderDto"
10338
+ "400":
10339
+ description: >
10340
+ `invalid_body` (missing, empty, unknown, or duplicate providers) or
10341
+ `provider_not_configured` (a key-based provider has no saved execution key; `provider`
10342
+ names it).
10343
+ content:
10344
+ application/json:
10345
+ schema:
10346
+ type: object
10347
+ required: [error]
10348
+ properties:
10349
+ error: { type: string, example: provider_not_configured }
10350
+ provider:
10351
+ $ref: "#/components/schemas/AgentExecutionProviderDto"
10352
+ "401":
10353
+ $ref: "#/components/responses/Unauthorized"
10354
+ "403":
10355
+ $ref: "#/components/responses/Forbidden"
10356
+
10244
10357
  /workspaces/{workspaceId}/code-intelligence:
10245
10358
  put:
10246
10359
  tags: [CodeChat]
@@ -16656,6 +16769,66 @@ components:
16656
16769
  type: string
16657
16770
  description: Atlassian account id when known from the last successful verify.
16658
16771
 
16772
+ LinearSourceDto:
16773
+ type: object
16774
+ description: >
16775
+ Linear source for `PUT /workspaces/{workspaceId}/sources` and
16776
+ `POST /workspaces/{workspaceId}/sources/test`. Uses a Linear personal API key
16777
+ (Linear → Settings → Security & access → Personal API keys). The API host is fixed
16778
+ (`https://api.linear.app/graphql`); there is no base URL field. Linear feeds Delivery
16779
+ (`ticket.created` / `ticket.completed`); it never emits incident events. A ticket mirrored
16780
+ in both Jira and Linear counts twice.
16781
+ required: [type, apiKey]
16782
+ additionalProperties: false
16783
+ properties:
16784
+ type:
16785
+ type: string
16786
+ enum: [linear]
16787
+ apiKey:
16788
+ type: string
16789
+ minLength: 1
16790
+ maxLength: 512
16791
+ description: >
16792
+ Linear personal API key (write-only on PUT). Sent as the raw `Authorization` header
16793
+ value; a value already prefixed with `Bearer ` is sent unchanged.
16794
+ teamKeys:
16795
+ type: string
16796
+ maxLength: 512
16797
+ description: >
16798
+ Optional comma-separated team keys (e.g. `ENG,OPS`). When set, only issues in these
16799
+ teams are ingested. Keys are matched case-insensitively. Send an empty string on
16800
+ `PUT` to clear a stored filter (every team the key can read).
16801
+ orgName:
16802
+ type: string
16803
+ description: Optional Linear workspace name from a successful connection test (echo-after-test).
16804
+ workspaceUrl:
16805
+ type: string
16806
+ description: Optional Linear workspace URL from a successful connection test (echo-after-test).
16807
+
16808
+ LinearSourceConfigDto:
16809
+ type: object
16810
+ description: >
16811
+ Redacted Linear source returned by `GET /workspaces/{workspaceId}/config`.
16812
+ Raw API key is never returned.
16813
+ required: [type, hasToken]
16814
+ additionalProperties: false
16815
+ properties:
16816
+ type:
16817
+ type: string
16818
+ enum: [linear]
16819
+ hasToken:
16820
+ type: boolean
16821
+ description: Whether a personal API key is stored for this workspace.
16822
+ teamKeys:
16823
+ type: string
16824
+ description: Configured comma-separated team-key filter, when set.
16825
+ orgName:
16826
+ type: string
16827
+ description: Linear workspace name when known from the last successful verify.
16828
+ workspaceUrl:
16829
+ type: string
16830
+ description: Linear workspace URL when known from the last successful verify.
16831
+
16659
16832
  AgentExecutionProviderDto:
16660
16833
  type: string
16661
16834
  description: >
@@ -16669,6 +16842,53 @@ components:
16669
16842
  - cursor_user_api_key
16670
16843
  - claude_api_key
16671
16844
 
16845
+ PutAgentExecutionProvidersDto:
16846
+ type: object
16847
+ required: [providers]
16848
+ properties:
16849
+ providers:
16850
+ type: array
16851
+ minItems: 1
16852
+ maxItems: 3
16853
+ uniqueItems: true
16854
+ description: Enabled providers in the order runs try them.
16855
+ items:
16856
+ $ref: "#/components/schemas/AgentExecutionProviderDto"
16857
+
16858
+ AgentExecutionSkipReasonDto:
16859
+ type: string
16860
+ description: >
16861
+ Why a run skipped an enabled provider and used the next one.
16862
+ - `missing_key`: no execution key is saved for the provider.
16863
+ - `invalid_key`: the provider rejected the key.
16864
+ - `budget_exhausted`: the account is out of credits or usage.
16865
+ - `rate_limited`: the provider is rate limiting requests.
16866
+ - `failed`: the provider errored.
16867
+ enum: [missing_key, invalid_key, budget_exhausted, rate_limited, failed]
16868
+
16869
+ AgentExecutionFallbackDto:
16870
+ type: object
16871
+ description: >
16872
+ Present when a run skipped one or more enabled agent execution providers (#1006).
16873
+ `ranWith` is the provider that ran, or null when every enabled provider was skipped.
16874
+ required: [ranWith, skipped]
16875
+ properties:
16876
+ ranWith:
16877
+ type: string
16878
+ nullable: true
16879
+ enum: [thinkai_platform_cursor, cursor_user_api_key, claude_api_key, null]
16880
+ skipped:
16881
+ type: array
16882
+ minItems: 1
16883
+ items:
16884
+ type: object
16885
+ required: [provider, reason]
16886
+ properties:
16887
+ provider:
16888
+ $ref: "#/components/schemas/AgentExecutionProviderDto"
16889
+ reason:
16890
+ $ref: "#/components/schemas/AgentExecutionSkipReasonDto"
16891
+
16672
16892
  PutCodeIntelligenceSettingsDto:
16673
16893
  type: object
16674
16894
  description: Partial update for Code Intelligence workspace settings (admin-only).
@@ -16872,6 +17092,7 @@ components:
16872
17092
  - $ref: "#/components/schemas/IncidentIoSourceConfigDto"
16873
17093
  - $ref: "#/components/schemas/SentrySourceConfigDto"
16874
17094
  - $ref: "#/components/schemas/JiraSourceConfigDto"
17095
+ - $ref: "#/components/schemas/LinearSourceConfigDto"
16875
17096
  - $ref: "#/components/schemas/TenantSourceEntryDto"
16876
17097
  orgChart:
16877
17098
  nullable: true
@@ -16895,6 +17116,16 @@ components:
16895
17116
  The single active agent execution account for this workspace's readiness scanner and
16896
17117
  fix processor. Defaults to `cursor_user_api_key`. Change via
16897
17118
  `PUT /workspaces/{workspaceId}/agent-execution-provider`.
17119
+ agentExecutionProviders:
17120
+ type: array
17121
+ minItems: 1
17122
+ items:
17123
+ $ref: "#/components/schemas/AgentExecutionProviderDto"
17124
+ description: >
17125
+ Enabled agent execution providers in the order runs try them (#1006). The first entry
17126
+ equals `agentExecutionProvider`. Workspaces saved before ordered fallback return
17127
+ `[agentExecutionProvider]`. Change via
17128
+ `PUT /workspaces/{workspaceId}/agent-execution-providers`.
16898
17129
  codeIntelligenceEnabled:
16899
17130
  type: boolean
16900
17131
  description: >
@@ -17374,7 +17605,7 @@ components:
17374
17605
  description: Error detail when `executionKeyValid` is false.
17375
17606
  userName:
17376
17607
  type: string
17377
- description: Present for New Relic, Grafana, PagerDuty, or Jira verify success — authenticated user name.
17608
+ description: Present for New Relic, Grafana, PagerDuty, Jira, or Linear verify success — authenticated user name.
17378
17609
  accountName:
17379
17610
  type: string
17380
17611
  description: Present for New Relic verify success — resolved account display name.
@@ -17383,7 +17614,15 @@ components:
17383
17614
  description: Present for New Relic or Jira verify success — resolved account ID.
17384
17615
  orgName:
17385
17616
  type: string
17386
- description: Present for Grafana, Datadog, or Sentry verify success — resolved organization name.
17617
+ description: Present for Grafana, Datadog, Sentry, or Linear verify success — resolved organization name.
17618
+ workspaceUrl:
17619
+ type: string
17620
+ description: Present for Linear verify success — workspace URL (`https://linear.app/{urlKey}`).
17621
+ warning:
17622
+ type: string
17623
+ description: >
17624
+ Non-blocking notice on success. Linear: `No teams matched <keys>` when the team-key
17625
+ filter matches no team visible to the key (empty polls are valid).
17387
17626
  keyName:
17388
17627
  type: string
17389
17628
  description: Present for incident.io verify success — API key name from `GET /v1/identity`.
@@ -19402,6 +19641,12 @@ components:
19402
19641
  totalEngineers:
19403
19642
  type: integer
19404
19643
  minimum: 0
19644
+ requestCount:
19645
+ type: integer
19646
+ minimum: 0
19647
+ description: >-
19648
+ Model requests in the window from daily usage rows. Set for org-level providers
19649
+ (ChatGPT, Gemini) whose usage APIs report requests rather than per-user seats.
19405
19650
  weekBuckets:
19406
19651
  type: array
19407
19652
  items:
@@ -20254,6 +20499,75 @@ components:
20254
20499
  format: uri
20255
20500
  nullable: true
20256
20501
 
20502
+ GithubRecentCommitAuthorsRequestDto:
20503
+ type: object
20504
+ additionalProperties: false
20505
+ required: [from, to, repos]
20506
+ properties:
20507
+ from:
20508
+ type: string
20509
+ format: date
20510
+ description: Inclusive window start (YYYY-MM-DD).
20511
+ to:
20512
+ type: string
20513
+ format: date
20514
+ description: Inclusive window end (YYYY-MM-DD). Cache key.
20515
+ repos:
20516
+ type: array
20517
+ minItems: 1
20518
+ maxItems: 40
20519
+ items:
20520
+ $ref: "#/components/schemas/GithubRecentCommitAuthorRepoDto"
20521
+ GithubRecentCommitAuthorRepoDto:
20522
+ type: object
20523
+ additionalProperties: false
20524
+ required: [id, fullName]
20525
+ properties:
20526
+ id:
20527
+ type: string
20528
+ description: GitHub repository id from the granted-repository list.
20529
+ fullName:
20530
+ type: string
20531
+ description: owner/name
20532
+ GithubRecentCommitSampleDto:
20533
+ type: object
20534
+ additionalProperties: false
20535
+ required: [authorLogin, authoredAt]
20536
+ properties:
20537
+ authorLogin:
20538
+ type: string
20539
+ nullable: true
20540
+ authoredAt:
20541
+ type: string
20542
+ nullable: true
20543
+ format: date-time
20544
+ GithubRecentCommitAuthorResultDto:
20545
+ type: object
20546
+ additionalProperties: false
20547
+ required: [id, fullName, complete]
20548
+ properties:
20549
+ id:
20550
+ type: string
20551
+ fullName:
20552
+ type: string
20553
+ complete:
20554
+ type: boolean
20555
+ description: False when the lookup failed or the page did not contain a human author.
20556
+ error:
20557
+ type: string
20558
+ commits:
20559
+ type: array
20560
+ items:
20561
+ $ref: "#/components/schemas/GithubRecentCommitSampleDto"
20562
+ GithubRecentCommitAuthorsResponseDto:
20563
+ type: object
20564
+ additionalProperties: false
20565
+ required: [results]
20566
+ properties:
20567
+ results:
20568
+ type: array
20569
+ items:
20570
+ $ref: "#/components/schemas/GithubRecentCommitAuthorResultDto"
20257
20571
  GithubInstalledRepoDto:
20258
20572
  type: object
20259
20573
  required: [id, name]
@@ -21572,6 +21886,18 @@ components:
21572
21886
  $ref: "#/components/schemas/TechCategoryDto"
21573
21887
  security:
21574
21888
  $ref: "#/components/schemas/TechCategoryDto"
21889
+ codeAnalysis:
21890
+ description: >-
21891
+ Code analysis & quality tools (SonarQube, Codacy, …). Optional on PUT; omitted keeps the
21892
+ saved value. GET always returns it.
21893
+ allOf:
21894
+ - $ref: "#/components/schemas/TechCategoryDto"
21895
+ codeReview:
21896
+ description: >-
21897
+ Code review tools (CodeRabbit, Graphite, …). Optional on PUT; omitted keeps the saved
21898
+ value. GET always returns it.
21899
+ allOf:
21900
+ - $ref: "#/components/schemas/TechCategoryDto"
21575
21901
  knowledgeDocs:
21576
21902
  $ref: "#/components/schemas/TechCategoryDto"
21577
21903
  hrPeople:
@@ -22909,6 +23235,12 @@ components:
22909
23235
  type: string
22910
23236
  nullable: true
22911
23237
  description: Human-readable error detail from the last failed run. Present when `lastRunStatus` is `failed` or `partial_failed`.
23238
+ lastRunAgentExecution:
23239
+ allOf:
23240
+ - $ref: "#/components/schemas/AgentExecutionFallbackDto"
23241
+ description: >
23242
+ Present when the most recent completed run skipped an enabled agent execution provider
23243
+ and fell back to the next one (or failed after trying all of them).
22912
23244
  archivedAt:
22913
23245
  type: string
22914
23246
  format: date-time
@@ -22930,8 +23262,14 @@ components:
22930
23262
  Why the repo was archived. `github_archived` means the repo is still granted by the
22931
23263
  GitHub installation but GitHub reports `archived === true` (default sync excludes it).
22932
23264
  `github_removed` means the slug is no longer in the installation listing.
22933
- `user_removed` means excluded from Agentic Foundation scope only. Only present when
23265
+ `user_removed` means the user marked the repo Inactive: it is not scanned, and stays in
23266
+ productivity and SDLC ingest unless `excludedFromIngest` is true. Only present when
22934
23267
  `archivedAt` is set.
23268
+ excludedFromIngest:
23269
+ type: boolean
23270
+ description: >
23271
+ True when the GitHub repository selection unchecked this Inactive repo, so it is also
23272
+ left out of productivity and SDLC ingest (v2.210.0+). Omitted otherwise.
22935
23273
  eligibilityStatus:
22936
23274
  type: string
22937
23275
  enum: [eligible, ineligible]
@@ -23138,6 +23476,8 @@ components:
23138
23476
  lastRunErrorDetail:
23139
23477
  type: string
23140
23478
  nullable: true
23479
+ lastRunAgentExecution:
23480
+ $ref: "#/components/schemas/AgentExecutionFallbackDto"
23141
23481
  archivedAt:
23142
23482
  type: string
23143
23483
  format: date-time
@@ -23155,6 +23495,9 @@ components:
23155
23495
  user_removed,
23156
23496
  ]
23157
23497
  description: See RepoReadinessScoreDto.archivedReason.
23498
+ excludedFromIngest:
23499
+ type: boolean
23500
+ description: See RepoReadinessScoreDto.excludedFromIngest.
23158
23501
  eligibilityStatus:
23159
23502
  type: string
23160
23503
  enum: [eligible, ineligible]
@@ -25035,6 +25378,12 @@ components:
25035
25378
  maxItems: 200
25036
25379
  items:
25037
25380
  $ref: "#/components/schemas/PutAgenticFoundationRepoScopeChangeDto"
25381
+ excludeFromIngest:
25382
+ type: boolean
25383
+ description: >
25384
+ GitHub repository selection (v2.210.0+). When true, excluded repos also leave
25385
+ productivity and SDLC ingest, including repos that were already Inactive. Omit for
25386
+ Agentic Foundation scope changes, which only affect scans.
25038
25387
 
25039
25388
  PutAgenticFoundationRepoScopeAppliedDto:
25040
25389
  type: object
@@ -25107,6 +25456,7 @@ components:
25107
25456
  - readiness.scan_completed
25108
25457
  - readiness.scan_failed
25109
25458
  - readiness.scan_partial
25459
+ - readiness.agent_execution_fallback
25110
25460
  - code_insights.design_run_started
25111
25461
  - integrations.agent_execution.provider_changed
25112
25462
  - integrations.repo_eligibility.overrides_changed
@@ -26901,6 +27251,10 @@ components:
26901
27251
  type: string
26902
27252
  kind:
26903
27253
  type: string
27254
+ description: >
27255
+ `linear` (v2.210.0+) is the last Linear poll from the productivity worker: `failed`
27256
+ with `lastErrorKind` `invalid_token` when the key was revoked, `incremental` after a
27257
+ successful poll, `sync.eventCount` for tickets read. Listed only while Linear is connected.
26904
27258
  enum:
26905
27259
  [
26906
27260
  productivity_github,
@@ -26911,6 +27265,7 @@ components:
26911
27265
  hris,
26912
27266
  jira,
26913
27267
  pagerduty,
27268
+ linear,
26914
27269
  ]
26915
27270
  provider:
26916
27271
  type: string
@@ -26960,8 +27315,8 @@ components:
26960
27315
  instant means the poll is overdue and is not advanced to now), hris (next
26961
27316
  PHASE2 daily UTC cron `15 2` after now), and monitoring (next PHASE2 daily
26962
27317
  UTC cron `30 2` after now). HRIS/Monitoring values are always in the future
26963
- when set — not lastAttempt plus interval. Null for productivity_github and
26964
- sdlc_github, when the sync worker is disabled, or when there has been no
27318
+ when set — not lastAttempt plus interval. Null for productivity_github,
27319
+ sdlc_github, linear, when the sync worker is disabled, or when there has been no
26965
27320
  attempt (hris/monitoring: last status never). Not an ETA.
26966
27321
  staleForMs:
26967
27322
  type: integer
@@ -29232,7 +29587,7 @@ components:
29232
29587
  properties:
29233
29588
  operation:
29234
29589
  type: string
29235
- description: Ledger operation key (code_chat, prd_generate, workspace_kb, wiki_json_outline, wiki_enrich, …)
29590
+ description: Ledger operation key (code_chat, prd_generate, workspace_kb, wiki, …). Older rows may still say wiki_enrich or wiki_json_outline; clients collapse those into Wiki.
29236
29591
  provider: { type: string }
29237
29592
  model: { type: string, nullable: true }
29238
29593
  inputTokens: { type: integer, minimum: 0 }
@@ -29269,6 +29624,33 @@ components:
29269
29624
  byOperation:
29270
29625
  type: array
29271
29626
  items: { $ref: "#/components/schemas/CodeIntelligenceTokenUsageByOperationDto" }
29627
+ runs:
29628
+ type: array
29629
+ description: >-
29630
+ Knowledge jobs (wiki scans and similar) whose tokens make up this repository
29631
+ total. Newest first. Absent on older servers.
29632
+ items: { $ref: "#/components/schemas/CodeIntelligenceTokenUsageRunDto" }
29633
+
29634
+ CodeIntelligenceTokenUsageRunDto:
29635
+ type: object
29636
+ required:
29637
+ - operation
29638
+ - inputTokens
29639
+ - outputTokens
29640
+ - estimatedCostUsd
29641
+ - invocationCount
29642
+ properties:
29643
+ jobId: { type: string, format: uuid, nullable: true }
29644
+ startedAt: { type: string, format: date-time, nullable: true }
29645
+ status:
29646
+ type: string
29647
+ nullable: true
29648
+ description: Knowledge job status (queued, running, completed, failed).
29649
+ operation: { type: string }
29650
+ inputTokens: { type: integer, minimum: 0 }
29651
+ outputTokens: { type: integer, minimum: 0 }
29652
+ estimatedCostUsd: { type: number }
29653
+ invocationCount: { type: integer, minimum: 0 }
29272
29654
 
29273
29655
  CodeIntelligenceTokenUsageSummaryDto:
29274
29656
  type: object
@@ -29301,8 +29683,8 @@ components:
29301
29683
  byRepo:
29302
29684
  type: array
29303
29685
  description: >-
29304
- Per-repository split (wiki generation, conversations, outline). Only rows with
29305
- repository attribution appear here; workspace-wide operations stay in totals.
29686
+ Per-repository split (wiki generation, conversations, outline). Calls that were
29687
+ not about a single repository use an empty repoId and a null repoName.
29306
29688
  items: { $ref: "#/components/schemas/CodeIntelligenceTokenUsageByRepoDto" }
29307
29689
 
29308
29690
  CodeChatWikiPageListDto:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thinkai/tai-api-contract",
3
- "version": "2.209.1",
3
+ "version": "2.210.1",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "dist/index.js",