@thinkai/tai-api-contract 2.231.2 → 2.233.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.231.2
4
+ version: 2.233.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}/...`.
@@ -12302,6 +12302,34 @@ paths:
12302
12302
  "404":
12303
12303
  description: Not found
12304
12304
 
12305
+ /workspaces/{workspaceId}/code-chat/indexes/{indexId}/arch-doc:
12306
+ get:
12307
+ tags: [CodeChat]
12308
+ summary: Architecture document (.arch.md) for one repository index
12309
+ description: >
12310
+ The standard-shaped architecture document the last scan stored, beside how the document
12311
+ step ended. It is written during indexing from the code, and is the only architecture
12312
+ artifact: the short fields Ask searches are read out of it. Read-only; never calls a model. A repository scanned without documents
12313
+ returns status `missing` and a plain-words next step.
12314
+ operationId: getCodeChatArchDoc
12315
+ parameters:
12316
+ - $ref: "#/components/parameters/WorkspaceId"
12317
+ - name: indexId
12318
+ in: path
12319
+ required: true
12320
+ schema: { type: string, format: uuid }
12321
+ responses:
12322
+ "200":
12323
+ description: Document and step outcome
12324
+ content:
12325
+ application/json:
12326
+ schema:
12327
+ $ref: "#/components/schemas/CodeChatArchDocViewDto"
12328
+ "401":
12329
+ $ref: "#/components/responses/Unauthorized"
12330
+ "404":
12331
+ description: Index not found
12332
+
12305
12333
  /workspaces/{workspaceId}/code-chat/indexes/{indexId}/wiki-config:
12306
12334
  get:
12307
12335
  tags: [CodeChat]
@@ -19129,6 +19157,66 @@ components:
19129
19157
  reason:
19130
19158
  $ref: "#/components/schemas/AgentExecutionSkipReasonDto"
19131
19159
 
19160
+ CodeIntelligenceTaskModelDto:
19161
+ type: object
19162
+ description: >
19163
+ Model ids for one Code Intelligence task. A model id left out uses the platform default for
19164
+ the task (or, for `ask_explore`, the `ask_synthesize` pick). `useWorkspaceModel: true` runs the
19165
+ workspace-wide `cursorModel` / `claudeModel` instead and cannot be combined with a model id.
19166
+ additionalProperties: false
19167
+ properties:
19168
+ useWorkspaceModel:
19169
+ type: boolean
19170
+ nullable: true
19171
+ description: When true, the task runs the workspace-wide model instead of the platform default.
19172
+ cursorModel:
19173
+ type: string
19174
+ nullable: true
19175
+ minLength: 1
19176
+ maxLength: 120
19177
+ claudeModel:
19178
+ type: string
19179
+ nullable: true
19180
+ minLength: 1
19181
+ maxLength: 120
19182
+ CodeIntelligenceTaskModelDefaultsDto:
19183
+ type: object
19184
+ description: Platform default model ids per Code Intelligence task.
19185
+ required: [index_bulk, ask_synthesize, ask_explore]
19186
+ properties:
19187
+ index_bulk:
19188
+ $ref: "#/components/schemas/CodeIntelligenceTaskModelDefaultDto"
19189
+ ask_synthesize:
19190
+ $ref: "#/components/schemas/CodeIntelligenceTaskModelDefaultDto"
19191
+ ask_explore:
19192
+ $ref: "#/components/schemas/CodeIntelligenceTaskModelDefaultDto"
19193
+ CodeIntelligenceTaskModelDefaultDto:
19194
+ type: object
19195
+ required: [cursorModel, claudeModel]
19196
+ properties:
19197
+ cursorModel:
19198
+ type: string
19199
+ claudeModel:
19200
+ type: string
19201
+ CodeIntelligenceModelsByTaskDto:
19202
+ type: object
19203
+ nullable: true
19204
+ description: >
19205
+ Per-task model routing for Code Intelligence (ECG use cases). `index_bulk` is high-volume
19206
+ index-time work (rule-card describe, wiki outline and enrich). `ask_synthesize` writes the
19207
+ Ask answer. `ask_explore` is the Explore planner and inherits `ask_synthesize` when its cell
19208
+ is empty. A task with no cell runs the platform default for that task
19209
+ (see `codeIntelligenceTaskModelDefaults` on the workspace configuration). Set
19210
+ `useWorkspaceModel` on a task to run the workspace-wide `cursorModel` / `claudeModel`
19211
+ instead. Null clears every per-task model. Unknown task keys are rejected.
19212
+ additionalProperties: false
19213
+ properties:
19214
+ index_bulk:
19215
+ $ref: "#/components/schemas/CodeIntelligenceTaskModelDto"
19216
+ ask_synthesize:
19217
+ $ref: "#/components/schemas/CodeIntelligenceTaskModelDto"
19218
+ ask_explore:
19219
+ $ref: "#/components/schemas/CodeIntelligenceTaskModelDto"
19132
19220
  PutCodeIntelligenceSettingsDto:
19133
19221
  type: object
19134
19222
  description: Partial update for Code Intelligence workspace settings (admin-only).
@@ -19150,6 +19238,10 @@ components:
19150
19238
  type: string
19151
19239
  nullable: true
19152
19240
  minLength: 1
19241
+ modelsByTask:
19242
+ nullable: true
19243
+ allOf:
19244
+ - $ref: "#/components/schemas/CodeIntelligenceModelsByTaskDto"
19153
19245
  indexingEnabled:
19154
19246
  type: boolean
19155
19247
  description: >
@@ -19456,6 +19548,18 @@ components:
19456
19548
  type: string
19457
19549
  nullable: true
19458
19550
  description: Optional Claude model override for Code Intelligence (null/empty → env default).
19551
+ codeIntelligenceModelsByTask:
19552
+ nullable: true
19553
+ description: Per-task model routing (`index_bulk`, `ask_synthesize`, `ask_explore`). Null when every task runs its platform default.
19554
+ allOf:
19555
+ - $ref: "#/components/schemas/CodeIntelligenceModelsByTaskDto"
19556
+ codeIntelligenceTaskModelDefaults:
19557
+ readOnly: true
19558
+ description: >
19559
+ The model each task runs when it has no cell of its own (the platform default), per
19560
+ provider. The screen reads this so it never states a model the server does not use.
19561
+ allOf:
19562
+ - $ref: "#/components/schemas/CodeIntelligenceTaskModelDefaultsDto"
19459
19563
  codeIntelligenceIndexingEnabled:
19460
19564
  type: boolean
19461
19565
  description: >
@@ -31877,6 +31981,71 @@ components:
31877
31981
  hasCodeExcerpts:
31878
31982
  type: boolean
31879
31983
  description: True when the indexed graph stores durable code excerpts (required for useful chat answers).
31984
+ ruleCards:
31985
+ allOf:
31986
+ - $ref: "#/components/schemas/CodeChatIndexRuleCardsDto"
31987
+ nullable: true
31988
+ description: >
31989
+ How the decision-line card step ended on the last scan. Null when no card step has
31990
+ reported for this index (scanned before cards existed, or by an older worker).
31991
+ archDoc:
31992
+ allOf:
31993
+ - $ref: "#/components/schemas/CodeChatIndexArchDocDto"
31994
+ nullable: true
31995
+ description: >
31996
+ How the architecture document step ended on the last scan. Null when no document
31997
+ step has reported for this index (documents off, or scanned by an older worker).
31998
+
31999
+ CodeChatIndexRuleCardsDto:
32000
+ type: object
32001
+ required: [status, reason, cards, updatedAt]
32002
+ properties:
32003
+ status:
32004
+ type: string
32005
+ enum: [ready, partial, failed, skipped]
32006
+ description: >
32007
+ ready: every card was embedded. partial: some cards have no description or were not
32008
+ embedded; the rest are searchable. failed: the step errored and cards from the last
32009
+ good scan are kept. skipped: the step did not run (turned off, or no model or
32010
+ embeddings key).
32011
+ reason:
32012
+ type: string
32013
+ nullable: true
32014
+ description: Plain-words explanation and next step. Null when status is ready with cards written.
32015
+ cards: { type: integer, minimum: 0, description: Decision lines found in this repository. }
32016
+ updatedAt: { type: string, format: date-time, nullable: true }
32017
+
32018
+ CodeChatIndexArchDocDto:
32019
+ type: object
32020
+ required: [status, reason, updatedAt]
32021
+ properties:
32022
+ status:
32023
+ type: string
32024
+ enum: [ready, failed, skipped]
32025
+ description: >
32026
+ ready: document stored for this commit. failed: the step errored and the earlier
32027
+ document is kept. skipped: the step did not run (no model key, or too little code).
32028
+ reason:
32029
+ { type: string, nullable: true, description: "Plain-words explanation and next step." }
32030
+ updatedAt: { type: string, format: date-time, nullable: true }
32031
+
32032
+ CodeChatArchDocViewDto:
32033
+ type: object
32034
+ required: [status, reason, updatedAt, stale, markdown]
32035
+ properties:
32036
+ status:
32037
+ type: string
32038
+ enum: [ready, failed, skipped, missing]
32039
+ description: missing means no step has reported and nothing is stored.
32040
+ reason: { type: string, nullable: true }
32041
+ updatedAt: { type: string, format: date-time, nullable: true }
32042
+ stale:
32043
+ type: boolean
32044
+ description: The document was written for an earlier commit than the index now holds.
32045
+ markdown:
32046
+ type: string
32047
+ nullable: true
32048
+ description: The `.arch.md` file content. Standard headings, in the same order for every repository.
31880
32049
 
31881
32050
  CodeChatIndexLastChangeDto:
31882
32051
  type: object
@@ -31930,6 +32099,23 @@ components:
31930
32099
  type: string
31931
32100
  nullable: true
31932
32101
  description: Human-readable detail (e.g. enriching · page 3/8 · how-it-works).
32102
+ steps:
32103
+ type: array
32104
+ nullable: true
32105
+ description: >
32106
+ The steps this scan runs, in order, with each step's status. Only planned steps
32107
+ appear (for example decision lines and the architecture document only when
32108
+ enabled, wiki only when the scan writes pages). Null for jobs queued before this field existed.
32109
+ items:
32110
+ type: object
32111
+ required: [key, status]
32112
+ properties:
32113
+ key:
32114
+ type: string
32115
+ enum: [acquire, extract, model, decision_lines, arch_doc, wiki]
32116
+ status:
32117
+ type: string
32118
+ enum: [planned, running, done, skipped, failed]
31933
32119
  phaseUpdatedAt: { type: string, format: date-time, nullable: true }
31934
32120
  trackAStatus:
31935
32121
  $ref: "#/components/schemas/CodeKnowledgeTrackStatus"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thinkai/tai-api-contract",
3
- "version": "2.231.2",
3
+ "version": "2.233.0",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -4528,6 +4528,26 @@ export interface paths {
4528
4528
  patch?: never;
4529
4529
  trace?: never;
4530
4530
  };
4531
+ "/workspaces/{workspaceId}/code-chat/indexes/{indexId}/arch-doc": {
4532
+ parameters: {
4533
+ query?: never;
4534
+ header?: never;
4535
+ path?: never;
4536
+ cookie?: never;
4537
+ };
4538
+ /**
4539
+ * Architecture document (.arch.md) for one repository index
4540
+ * @description The standard-shaped architecture document the last scan stored, beside how the document step ended. It is written during indexing from the code, and is the only architecture artifact: the short fields Ask searches are read out of it. Read-only; never calls a model. A repository scanned without documents returns status `missing` and a plain-words next step.
4541
+ */
4542
+ get: operations["getCodeChatArchDoc"];
4543
+ put?: never;
4544
+ post?: never;
4545
+ delete?: never;
4546
+ options?: never;
4547
+ head?: never;
4548
+ patch?: never;
4549
+ trace?: never;
4550
+ };
4531
4551
  "/workspaces/{workspaceId}/code-chat/indexes/{indexId}/wiki-config": {
4532
4552
  parameters: {
4533
4553
  query?: never;
@@ -7522,6 +7542,29 @@ export interface components {
7522
7542
  reason: components["schemas"]["AgentExecutionSkipReasonDto"];
7523
7543
  }[];
7524
7544
  };
7545
+ /** @description Model ids for one Code Intelligence task. A model id left out uses the platform default for the task (or, for `ask_explore`, the `ask_synthesize` pick). `useWorkspaceModel: true` runs the workspace-wide `cursorModel` / `claudeModel` instead and cannot be combined with a model id. */
7546
+ CodeIntelligenceTaskModelDto: {
7547
+ /** @description When true, the task runs the workspace-wide model instead of the platform default. */
7548
+ useWorkspaceModel?: boolean | null;
7549
+ cursorModel?: string | null;
7550
+ claudeModel?: string | null;
7551
+ };
7552
+ /** @description Platform default model ids per Code Intelligence task. */
7553
+ CodeIntelligenceTaskModelDefaultsDto: {
7554
+ index_bulk: components["schemas"]["CodeIntelligenceTaskModelDefaultDto"];
7555
+ ask_synthesize: components["schemas"]["CodeIntelligenceTaskModelDefaultDto"];
7556
+ ask_explore: components["schemas"]["CodeIntelligenceTaskModelDefaultDto"];
7557
+ };
7558
+ CodeIntelligenceTaskModelDefaultDto: {
7559
+ cursorModel: string;
7560
+ claudeModel: string;
7561
+ };
7562
+ /** @description Per-task model routing for Code Intelligence (ECG use cases). `index_bulk` is high-volume index-time work (rule-card describe, wiki outline and enrich). `ask_synthesize` writes the Ask answer. `ask_explore` is the Explore planner and inherits `ask_synthesize` when its cell is empty. A task with no cell runs the platform default for that task (see `codeIntelligenceTaskModelDefaults` on the workspace configuration). Set `useWorkspaceModel` on a task to run the workspace-wide `cursorModel` / `claudeModel` instead. Null clears every per-task model. Unknown task keys are rejected. */
7563
+ CodeIntelligenceModelsByTaskDto: {
7564
+ index_bulk?: components["schemas"]["CodeIntelligenceTaskModelDto"];
7565
+ ask_synthesize?: components["schemas"]["CodeIntelligenceTaskModelDto"];
7566
+ ask_explore?: components["schemas"]["CodeIntelligenceTaskModelDto"];
7567
+ } | null;
7525
7568
  /** @description Partial update for Code Intelligence workspace settings (admin-only). */
7526
7569
  PutCodeIntelligenceSettingsDto: {
7527
7570
  enabled?: boolean;
@@ -7530,6 +7573,7 @@ export interface components {
7530
7573
  provider?: components["schemas"]["AgentExecutionProviderDto"] | null;
7531
7574
  cursorModel?: string | null;
7532
7575
  claudeModel?: string | null;
7576
+ modelsByTask?: components["schemas"]["CodeIntelligenceModelsByTaskDto"] | null;
7533
7577
  /** @description When false, turning Engineering Context Graph on and the cadence tick do not enqueue index jobs. Stored graphs, wiki pages, and agent.md stay. Defaults to true. */
7534
7578
  indexingEnabled?: boolean;
7535
7579
  /**
@@ -7658,6 +7702,10 @@ export interface components {
7658
7702
  codeIntelligenceCursorModel?: string | null;
7659
7703
  /** @description Optional Claude model override for Code Intelligence (null/empty → env default). */
7660
7704
  codeIntelligenceClaudeModel?: string | null;
7705
+ /** @description Per-task model routing (`index_bulk`, `ask_synthesize`, `ask_explore`). Null when every task runs its platform default. */
7706
+ codeIntelligenceModelsByTask?: components["schemas"]["CodeIntelligenceModelsByTaskDto"] | null;
7707
+ /** @description The model each task runs when it has no cell of its own (the platform default), per provider. The screen reads this so it never states a model the server does not use. */
7708
+ readonly codeIntelligenceTaskModelDefaults?: components["schemas"]["CodeIntelligenceTaskModelDefaultsDto"];
7661
7709
  /** @description When false, enable-enqueue and the cadence tick do not start an index wave. Defaults to true. */
7662
7710
  codeIntelligenceIndexingEnabled?: boolean;
7663
7711
  /**
@@ -13290,6 +13338,48 @@ export interface components {
13290
13338
  updatedAt: string;
13291
13339
  /** @description True when the indexed graph stores durable code excerpts (required for useful chat answers). */
13292
13340
  hasCodeExcerpts?: boolean;
13341
+ /** @description How the decision-line card step ended on the last scan. Null when no card step has reported for this index (scanned before cards existed, or by an older worker). */
13342
+ ruleCards?: components["schemas"]["CodeChatIndexRuleCardsDto"] | null;
13343
+ /** @description How the architecture document step ended on the last scan. Null when no document step has reported for this index (documents off, or scanned by an older worker). */
13344
+ archDoc?: components["schemas"]["CodeChatIndexArchDocDto"] | null;
13345
+ };
13346
+ CodeChatIndexRuleCardsDto: {
13347
+ /**
13348
+ * @description ready: every card was embedded. partial: some cards have no description or were not embedded; the rest are searchable. failed: the step errored and cards from the last good scan are kept. skipped: the step did not run (turned off, or no model or embeddings key).
13349
+ * @enum {string}
13350
+ */
13351
+ status: "ready" | "partial" | "failed" | "skipped";
13352
+ /** @description Plain-words explanation and next step. Null when status is ready with cards written. */
13353
+ reason: string | null;
13354
+ /** @description Decision lines found in this repository. */
13355
+ cards: number;
13356
+ /** Format: date-time */
13357
+ updatedAt: string | null;
13358
+ };
13359
+ CodeChatIndexArchDocDto: {
13360
+ /**
13361
+ * @description ready: document stored for this commit. failed: the step errored and the earlier document is kept. skipped: the step did not run (no model key, or too little code).
13362
+ * @enum {string}
13363
+ */
13364
+ status: "ready" | "failed" | "skipped";
13365
+ /** @description Plain-words explanation and next step. */
13366
+ reason: string | null;
13367
+ /** Format: date-time */
13368
+ updatedAt: string | null;
13369
+ };
13370
+ CodeChatArchDocViewDto: {
13371
+ /**
13372
+ * @description missing means no step has reported and nothing is stored.
13373
+ * @enum {string}
13374
+ */
13375
+ status: "ready" | "failed" | "skipped" | "missing";
13376
+ reason: string | null;
13377
+ /** Format: date-time */
13378
+ updatedAt: string | null;
13379
+ /** @description The document was written for an earlier commit than the index now holds. */
13380
+ stale: boolean;
13381
+ /** @description The `.arch.md` file content. Standard headings, in the same order for every repository. */
13382
+ markdown: string | null;
13293
13383
  };
13294
13384
  CodeChatIndexLastChangeDto: {
13295
13385
  priorCommitSha: string;
@@ -13322,6 +13412,13 @@ export interface components {
13322
13412
  phase?: "cloning" | "indexing" | "track_a" | "track_b" | "completing" | null;
13323
13413
  /** @description Human-readable detail (e.g. enriching · page 3/8 · how-it-works). */
13324
13414
  phaseDetail?: string | null;
13415
+ /** @description The steps this scan runs, in order, with each step's status. Only planned steps appear (for example decision lines and the architecture document only when enabled, wiki only when the scan writes pages). Null for jobs queued before this field existed. */
13416
+ steps?: {
13417
+ /** @enum {string} */
13418
+ key: "acquire" | "extract" | "model" | "decision_lines" | "arch_doc" | "wiki";
13419
+ /** @enum {string} */
13420
+ status: "planned" | "running" | "done" | "skipped" | "failed";
13421
+ }[] | null;
13325
13422
  /** Format: date-time */
13326
13423
  phaseUpdatedAt?: string | null;
13327
13424
  trackAStatus?: components["schemas"]["CodeKnowledgeTrackStatus"];
@@ -15149,6 +15246,10 @@ export type AgentExecutionProviderDto = components['schemas']['AgentExecutionPro
15149
15246
  export type PutAgentExecutionProvidersDto = components['schemas']['PutAgentExecutionProvidersDto'];
15150
15247
  export type AgentExecutionSkipReasonDto = components['schemas']['AgentExecutionSkipReasonDto'];
15151
15248
  export type AgentExecutionFallbackDto = components['schemas']['AgentExecutionFallbackDto'];
15249
+ export type CodeIntelligenceTaskModelDto = components['schemas']['CodeIntelligenceTaskModelDto'];
15250
+ export type CodeIntelligenceTaskModelDefaultsDto = components['schemas']['CodeIntelligenceTaskModelDefaultsDto'];
15251
+ export type CodeIntelligenceTaskModelDefaultDto = components['schemas']['CodeIntelligenceTaskModelDefaultDto'];
15252
+ export type CodeIntelligenceModelsByTaskDto = components['schemas']['CodeIntelligenceModelsByTaskDto'];
15152
15253
  export type PutCodeIntelligenceSettingsDto = components['schemas']['PutCodeIntelligenceSettingsDto'];
15153
15254
  export type CodeWikiGuidanceTopicDto = components['schemas']['CodeWikiGuidanceTopicDto'];
15154
15255
  export type PutCodeIntelligenceAgentMdDto = components['schemas']['PutCodeIntelligenceAgentMdDto'];
@@ -15668,6 +15769,9 @@ export type InsightsRecommendationsPageBundleResponse = components['schemas']['I
15668
15769
  export type CodeChatIndexStatus = components['schemas']['CodeChatIndexStatus'];
15669
15770
  export type CodeChatIndexer = components['schemas']['CodeChatIndexer'];
15670
15771
  export type CodeChatIndexDto = components['schemas']['CodeChatIndexDto'];
15772
+ export type CodeChatIndexRuleCardsDto = components['schemas']['CodeChatIndexRuleCardsDto'];
15773
+ export type CodeChatIndexArchDocDto = components['schemas']['CodeChatIndexArchDocDto'];
15774
+ export type CodeChatArchDocViewDto = components['schemas']['CodeChatArchDocViewDto'];
15671
15775
  export type CodeChatIndexLastChangeDto = components['schemas']['CodeChatIndexLastChangeDto'];
15672
15776
  export type CodeKnowledgeJobDto = components['schemas']['CodeKnowledgeJobDto'];
15673
15777
  export type CodeKnowledgeTrackStatus = components['schemas']['CodeKnowledgeTrackStatus'];
@@ -28313,6 +28417,37 @@ export interface operations {
28313
28417
  };
28314
28418
  };
28315
28419
  };
28420
+ getCodeChatArchDoc: {
28421
+ parameters: {
28422
+ query?: never;
28423
+ header?: never;
28424
+ path: {
28425
+ workspaceId: components["parameters"]["WorkspaceId"];
28426
+ indexId: string;
28427
+ };
28428
+ cookie?: never;
28429
+ };
28430
+ requestBody?: never;
28431
+ responses: {
28432
+ /** @description Document and step outcome */
28433
+ 200: {
28434
+ headers: {
28435
+ [name: string]: unknown;
28436
+ };
28437
+ content: {
28438
+ "application/json": components["schemas"]["CodeChatArchDocViewDto"];
28439
+ };
28440
+ };
28441
+ 401: components["responses"]["Unauthorized"];
28442
+ /** @description Index not found */
28443
+ 404: {
28444
+ headers: {
28445
+ [name: string]: unknown;
28446
+ };
28447
+ content?: never;
28448
+ };
28449
+ };
28450
+ };
28316
28451
  getCodeChatEffectiveWikiConfig: {
28317
28452
  parameters: {
28318
28453
  query?: never;