@thinkai/tai-api-contract 2.254.1 → 2.256.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.254.1
4
+ version: 2.256.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}/...`.
@@ -12738,6 +12738,114 @@ paths:
12738
12738
  application/json:
12739
12739
  schema:
12740
12740
  $ref: "#/components/schemas/ErrorMessageDto"
12741
+ "429":
12742
+ description: >
12743
+ Too many questions. `ask_rate_limited` (per minute) or `ask_busy` (too many running
12744
+ at once), per user or per workspace. Nothing was spent. `Retry-After` and
12745
+ `retryAfterSec` say when to ask again.
12746
+ headers:
12747
+ Retry-After:
12748
+ schema: { type: integer }
12749
+ content:
12750
+ application/json:
12751
+ schema:
12752
+ $ref: "#/components/schemas/ErrorMessageDto"
12753
+
12754
+ /workspaces/{workspaceId}/code-chat/threads/{threadId}/messages/{messageId}/feedback:
12755
+ post:
12756
+ tags: [CodeChat]
12757
+ summary: Rate an assistant answer (thumbs up or down, with a reason)
12758
+ operationId: postCodeChatMessageFeedback
12759
+ x-test-coverage-skip: body rules covered by ask-feedback.test; store is RLS-scoped to the caller
12760
+ parameters:
12761
+ - $ref: "#/components/parameters/WorkspaceId"
12762
+ - name: threadId
12763
+ in: path
12764
+ required: true
12765
+ schema: { type: string, format: uuid }
12766
+ - name: messageId
12767
+ in: path
12768
+ required: true
12769
+ schema: { type: string, format: uuid }
12770
+ requestBody:
12771
+ required: true
12772
+ content:
12773
+ application/json:
12774
+ schema:
12775
+ $ref: "#/components/schemas/CodeChatAskFeedbackBodyDto"
12776
+ responses:
12777
+ "200":
12778
+ description: The caller's feedback after the change (null when cleared)
12779
+ content:
12780
+ application/json:
12781
+ schema:
12782
+ $ref: "#/components/schemas/CodeChatAskFeedbackResultDto"
12783
+ "400":
12784
+ description: Invalid rating or reason (`invalid_input`)
12785
+ content:
12786
+ application/json:
12787
+ schema:
12788
+ $ref: "#/components/schemas/ErrorMessageDto"
12789
+ "401":
12790
+ $ref: "#/components/responses/Unauthorized"
12791
+ "404":
12792
+ description: Thread or assistant message not found for the caller (`message_not_found`)
12793
+ content:
12794
+ application/json:
12795
+ schema:
12796
+ $ref: "#/components/schemas/ErrorMessageDto"
12797
+
12798
+ /workspaces/{workspaceId}/code-chat/feedback-settings:
12799
+ get:
12800
+ tags: [CodeChat]
12801
+ summary: Whether thumbs-down keeps the question for eval
12802
+ operationId: getCodeChatFeedbackSettings
12803
+ x-test-coverage-skip: single boolean read; covered by store tests
12804
+ parameters:
12805
+ - $ref: "#/components/parameters/WorkspaceId"
12806
+ responses:
12807
+ "200":
12808
+ description: Settings
12809
+ content:
12810
+ application/json:
12811
+ schema:
12812
+ $ref: "#/components/schemas/CodeChatFeedbackSettingsDto"
12813
+ "401":
12814
+ $ref: "#/components/responses/Unauthorized"
12815
+ put:
12816
+ tags: [CodeChat]
12817
+ summary: Turn question capture on or off (workspace admin)
12818
+ operationId: putCodeChatFeedbackSettings
12819
+ x-test-coverage-skip: single boolean write behind the admin check
12820
+ parameters:
12821
+ - $ref: "#/components/parameters/WorkspaceId"
12822
+ requestBody:
12823
+ required: true
12824
+ content:
12825
+ application/json:
12826
+ schema:
12827
+ $ref: "#/components/schemas/CodeChatFeedbackSettingsDto"
12828
+ responses:
12829
+ "200":
12830
+ description: Settings after the change
12831
+ content:
12832
+ application/json:
12833
+ schema:
12834
+ $ref: "#/components/schemas/CodeChatFeedbackSettingsDto"
12835
+ "400":
12836
+ description: captureQuestions must be a boolean (`invalid_input`)
12837
+ content:
12838
+ application/json:
12839
+ schema:
12840
+ $ref: "#/components/schemas/ErrorMessageDto"
12841
+ "401":
12842
+ $ref: "#/components/responses/Unauthorized"
12843
+ "403":
12844
+ description: Workspace admin required
12845
+ content:
12846
+ application/json:
12847
+ schema:
12848
+ $ref: "#/components/schemas/ErrorMessageDto"
12741
12849
 
12742
12850
  /workspaces/{workspaceId}/code-chat/indexes/{indexId}/wiki:
12743
12851
  get:
@@ -33919,6 +34027,30 @@ components:
33919
34027
  description: >
33920
34028
  How the architecture document step ended on the last scan. Null when no document
33921
34029
  step has reported for this index (documents off, or scanned by an older worker).
34030
+ scanCounts:
34031
+ allOf:
34032
+ - $ref: "#/components/schemas/CodeChatIndexScanCountsDto"
34033
+ nullable: true
34034
+ description: >
34035
+ Secret and low-signal counts from the last scan. Null until a scan writes them.
34036
+ All zeros means the scan ran and found nothing to report.
34037
+
34038
+ CodeChatIndexScanCountsDto:
34039
+ type: object
34040
+ required: [secretsRedacted, secretFilesSkipped, lowSignalFilesSkipped]
34041
+ properties:
34042
+ secretsRedacted:
34043
+ type: integer
34044
+ minimum: 0
34045
+ description: Secret values replaced in excerpts on the last scan.
34046
+ secretFilesSkipped:
34047
+ type: integer
34048
+ minimum: 0
34049
+ description: Files left unread because their name says they hold secrets.
34050
+ lowSignalFilesSkipped:
34051
+ type: integer
34052
+ minimum: 0
34053
+ description: Lockfiles, bundles, source maps and generated files skipped on the last scan.
33922
34054
 
33923
34055
  CodeChatIndexRuleCardsDto:
33924
34056
  type: object
@@ -34237,6 +34369,68 @@ components:
34237
34369
  description: >
34238
34370
  Hydrated from `tai_workspace_code_intelligence_token_usage` on GET thread
34239
34371
  detail (assistant turns). Omitted when no ledger rows exist for the message.
34372
+ verdict:
34373
+ type: string
34374
+ enum: [answered, caveat, clarifying, unconfirmed, retrieval_only, failed, timed_out]
34375
+ description: >
34376
+ Structured outcome of an assistant turn, so a client does not parse the answer text.
34377
+ `unconfirmed` means no quoted line from the code backed the answer. Present on
34378
+ assistant turns only.
34379
+ abstainReason:
34380
+ type: string
34381
+ nullable: true
34382
+ description: >
34383
+ Short code behind a `caveat` or `clarifying` turn (for example `ask-first`,
34384
+ `open-decisions`, `plan-only`). Null otherwise.
34385
+ feedback:
34386
+ allOf:
34387
+ - $ref: "#/components/schemas/CodeChatAskFeedbackDto"
34388
+ description: The caller's own thumbs on this answer. Omitted when none.
34389
+
34390
+ CodeChatAskFeedbackDto:
34391
+ type: object
34392
+ required: [rating, reason]
34393
+ properties:
34394
+ rating: { type: string, enum: [up, down] }
34395
+ reason:
34396
+ type: string
34397
+ nullable: true
34398
+ enum: [wrong, incomplete, not_grounded, too_slow, unclear, other, null]
34399
+ description: Why, for a thumbs-down. Null for a thumbs-up or when none was given.
34400
+
34401
+ CodeChatAskFeedbackBodyDto:
34402
+ type: object
34403
+ required: [rating]
34404
+ properties:
34405
+ rating:
34406
+ type: string
34407
+ nullable: true
34408
+ enum: [up, down, null]
34409
+ description: "`null` clears the caller's feedback on this answer."
34410
+ reason:
34411
+ type: string
34412
+ nullable: true
34413
+ enum: [wrong, incomplete, not_grounded, too_slow, unclear, other, null]
34414
+ description: Used for a thumbs-down only; dropped for a thumbs-up.
34415
+
34416
+ CodeChatAskFeedbackResultDto:
34417
+ type: object
34418
+ required: [feedback]
34419
+ properties:
34420
+ feedback:
34421
+ nullable: true
34422
+ allOf:
34423
+ - $ref: "#/components/schemas/CodeChatAskFeedbackDto"
34424
+
34425
+ CodeChatFeedbackSettingsDto:
34426
+ type: object
34427
+ required: [captureQuestions]
34428
+ properties:
34429
+ captureQuestions:
34430
+ type: boolean
34431
+ description: >
34432
+ When true, a thumbs-down also keeps the secret-scrubbed question for 30 days so the
34433
+ turn can become an eval case. Default false.
34240
34434
 
34241
34435
  CodeChatThreadDetailDto:
34242
34436
  allOf:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thinkai/tai-api-contract",
3
- "version": "2.254.1",
3
+ "version": "2.256.0",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -4616,6 +4616,41 @@ export interface paths {
4616
4616
  patch?: never;
4617
4617
  trace?: never;
4618
4618
  };
4619
+ "/workspaces/{workspaceId}/code-chat/threads/{threadId}/messages/{messageId}/feedback": {
4620
+ parameters: {
4621
+ query?: never;
4622
+ header?: never;
4623
+ path?: never;
4624
+ cookie?: never;
4625
+ };
4626
+ get?: never;
4627
+ put?: never;
4628
+ /** Rate an assistant answer (thumbs up or down, with a reason) */
4629
+ post: operations["postCodeChatMessageFeedback"];
4630
+ delete?: never;
4631
+ options?: never;
4632
+ head?: never;
4633
+ patch?: never;
4634
+ trace?: never;
4635
+ };
4636
+ "/workspaces/{workspaceId}/code-chat/feedback-settings": {
4637
+ parameters: {
4638
+ query?: never;
4639
+ header?: never;
4640
+ path?: never;
4641
+ cookie?: never;
4642
+ };
4643
+ /** Whether thumbs-down keeps the question for eval */
4644
+ get: operations["getCodeChatFeedbackSettings"];
4645
+ /** Turn question capture on or off (workspace admin) */
4646
+ put: operations["putCodeChatFeedbackSettings"];
4647
+ post?: never;
4648
+ delete?: never;
4649
+ options?: never;
4650
+ head?: never;
4651
+ patch?: never;
4652
+ trace?: never;
4653
+ };
4619
4654
  "/workspaces/{workspaceId}/code-chat/indexes/{indexId}/wiki": {
4620
4655
  parameters: {
4621
4656
  query?: never;
@@ -14006,6 +14041,16 @@ export interface components {
14006
14041
  ruleCards?: components["schemas"]["CodeChatIndexRuleCardsDto"] | null;
14007
14042
  /** @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). */
14008
14043
  archDoc?: components["schemas"]["CodeChatIndexArchDocDto"] | null;
14044
+ /** @description Secret and low-signal counts from the last scan. Null until a scan writes them. All zeros means the scan ran and found nothing to report. */
14045
+ scanCounts?: components["schemas"]["CodeChatIndexScanCountsDto"] | null;
14046
+ };
14047
+ CodeChatIndexScanCountsDto: {
14048
+ /** @description Secret values replaced in excerpts on the last scan. */
14049
+ secretsRedacted: number;
14050
+ /** @description Files left unread because their name says they hold secrets. */
14051
+ secretFilesSkipped: number;
14052
+ /** @description Lockfiles, bundles, source maps and generated files skipped on the last scan. */
14053
+ lowSignalFilesSkipped: number;
14009
14054
  };
14010
14055
  CodeChatIndexRuleCardsDto: {
14011
14056
  /**
@@ -14214,6 +14259,43 @@ export interface components {
14214
14259
  attachments?: components["schemas"]["CodeChatAttachmentMetaDto"][];
14215
14260
  /** @description Hydrated from `tai_workspace_code_intelligence_token_usage` on GET thread detail (assistant turns). Omitted when no ledger rows exist for the message. */
14216
14261
  usage?: components["schemas"]["CodeIntelligenceUsageDto"];
14262
+ /**
14263
+ * @description Structured outcome of an assistant turn, so a client does not parse the answer text. `unconfirmed` means no quoted line from the code backed the answer. Present on assistant turns only.
14264
+ * @enum {string}
14265
+ */
14266
+ verdict?: "answered" | "caveat" | "clarifying" | "unconfirmed" | "retrieval_only" | "failed" | "timed_out";
14267
+ /** @description Short code behind a `caveat` or `clarifying` turn (for example `ask-first`, `open-decisions`, `plan-only`). Null otherwise. */
14268
+ abstainReason?: string | null;
14269
+ /** @description The caller's own thumbs on this answer. Omitted when none. */
14270
+ feedback?: components["schemas"]["CodeChatAskFeedbackDto"];
14271
+ };
14272
+ CodeChatAskFeedbackDto: {
14273
+ /** @enum {string} */
14274
+ rating: "up" | "down";
14275
+ /**
14276
+ * @description Why, for a thumbs-down. Null for a thumbs-up or when none was given.
14277
+ * @enum {string|null}
14278
+ */
14279
+ reason: "wrong" | "incomplete" | "not_grounded" | "too_slow" | "unclear" | "other" | null;
14280
+ };
14281
+ CodeChatAskFeedbackBodyDto: {
14282
+ /**
14283
+ * @description `null` clears the caller's feedback on this answer.
14284
+ * @enum {string|null}
14285
+ */
14286
+ rating: "up" | "down" | null;
14287
+ /**
14288
+ * @description Used for a thumbs-down only; dropped for a thumbs-up.
14289
+ * @enum {string|null}
14290
+ */
14291
+ reason?: "wrong" | "incomplete" | "not_grounded" | "too_slow" | "unclear" | "other" | null;
14292
+ };
14293
+ CodeChatAskFeedbackResultDto: {
14294
+ feedback: components["schemas"]["CodeChatAskFeedbackDto"] | null;
14295
+ };
14296
+ CodeChatFeedbackSettingsDto: {
14297
+ /** @description When true, a thumbs-down also keeps the secret-scrubbed question for 30 days so the turn can become an eval case. Default false. */
14298
+ captureQuestions: boolean;
14217
14299
  };
14218
14300
  CodeChatThreadDetailDto: components["schemas"]["CodeChatThreadDto"] & {
14219
14301
  messages: components["schemas"]["CodeChatMessageDto"][];
@@ -16661,6 +16743,7 @@ export type InsightsRecommendationsPageBundleResponse = components['schemas']['I
16661
16743
  export type CodeChatIndexStatus = components['schemas']['CodeChatIndexStatus'];
16662
16744
  export type CodeChatIndexer = components['schemas']['CodeChatIndexer'];
16663
16745
  export type CodeChatIndexDto = components['schemas']['CodeChatIndexDto'];
16746
+ export type CodeChatIndexScanCountsDto = components['schemas']['CodeChatIndexScanCountsDto'];
16664
16747
  export type CodeChatIndexRuleCardsDto = components['schemas']['CodeChatIndexRuleCardsDto'];
16665
16748
  export type CodeChatIndexArchDocDto = components['schemas']['CodeChatIndexArchDocDto'];
16666
16749
  export type CodeChatArchDocViewDto = components['schemas']['CodeChatArchDocViewDto'];
@@ -16678,6 +16761,10 @@ export type CodeChatThreadListDto = components['schemas']['CodeChatThreadListDto
16678
16761
  export type CodeChatCreateThreadBodyDto = components['schemas']['CodeChatCreateThreadBodyDto'];
16679
16762
  export type CodeChatCitationDto = components['schemas']['CodeChatCitationDto'];
16680
16763
  export type CodeChatMessageDto = components['schemas']['CodeChatMessageDto'];
16764
+ export type CodeChatAskFeedbackDto = components['schemas']['CodeChatAskFeedbackDto'];
16765
+ export type CodeChatAskFeedbackBodyDto = components['schemas']['CodeChatAskFeedbackBodyDto'];
16766
+ export type CodeChatAskFeedbackResultDto = components['schemas']['CodeChatAskFeedbackResultDto'];
16767
+ export type CodeChatFeedbackSettingsDto = components['schemas']['CodeChatFeedbackSettingsDto'];
16681
16768
  export type CodeChatThreadDetailDto = components['schemas']['CodeChatThreadDetailDto'];
16682
16769
  export type CodeChatPostMessageBodyDto = components['schemas']['CodeChatPostMessageBodyDto'];
16683
16770
  export type CodeChatUploadAttachmentBodyDto = components['schemas']['CodeChatUploadAttachmentBodyDto'];
@@ -29708,6 +29795,131 @@ export interface operations {
29708
29795
  "application/json": components["schemas"]["ErrorMessageDto"];
29709
29796
  };
29710
29797
  };
29798
+ /** @description Too many questions. `ask_rate_limited` (per minute) or `ask_busy` (too many running at once), per user or per workspace. Nothing was spent. `Retry-After` and `retryAfterSec` say when to ask again. */
29799
+ 429: {
29800
+ headers: {
29801
+ "Retry-After"?: number;
29802
+ [name: string]: unknown;
29803
+ };
29804
+ content: {
29805
+ "application/json": components["schemas"]["ErrorMessageDto"];
29806
+ };
29807
+ };
29808
+ };
29809
+ };
29810
+ postCodeChatMessageFeedback: {
29811
+ parameters: {
29812
+ query?: never;
29813
+ header?: never;
29814
+ path: {
29815
+ workspaceId: components["parameters"]["WorkspaceId"];
29816
+ threadId: string;
29817
+ messageId: string;
29818
+ };
29819
+ cookie?: never;
29820
+ };
29821
+ requestBody: {
29822
+ content: {
29823
+ "application/json": components["schemas"]["CodeChatAskFeedbackBodyDto"];
29824
+ };
29825
+ };
29826
+ responses: {
29827
+ /** @description The caller's feedback after the change (null when cleared) */
29828
+ 200: {
29829
+ headers: {
29830
+ [name: string]: unknown;
29831
+ };
29832
+ content: {
29833
+ "application/json": components["schemas"]["CodeChatAskFeedbackResultDto"];
29834
+ };
29835
+ };
29836
+ /** @description Invalid rating or reason (`invalid_input`) */
29837
+ 400: {
29838
+ headers: {
29839
+ [name: string]: unknown;
29840
+ };
29841
+ content: {
29842
+ "application/json": components["schemas"]["ErrorMessageDto"];
29843
+ };
29844
+ };
29845
+ 401: components["responses"]["Unauthorized"];
29846
+ /** @description Thread or assistant message not found for the caller (`message_not_found`) */
29847
+ 404: {
29848
+ headers: {
29849
+ [name: string]: unknown;
29850
+ };
29851
+ content: {
29852
+ "application/json": components["schemas"]["ErrorMessageDto"];
29853
+ };
29854
+ };
29855
+ };
29856
+ };
29857
+ getCodeChatFeedbackSettings: {
29858
+ parameters: {
29859
+ query?: never;
29860
+ header?: never;
29861
+ path: {
29862
+ workspaceId: components["parameters"]["WorkspaceId"];
29863
+ };
29864
+ cookie?: never;
29865
+ };
29866
+ requestBody?: never;
29867
+ responses: {
29868
+ /** @description Settings */
29869
+ 200: {
29870
+ headers: {
29871
+ [name: string]: unknown;
29872
+ };
29873
+ content: {
29874
+ "application/json": components["schemas"]["CodeChatFeedbackSettingsDto"];
29875
+ };
29876
+ };
29877
+ 401: components["responses"]["Unauthorized"];
29878
+ };
29879
+ };
29880
+ putCodeChatFeedbackSettings: {
29881
+ parameters: {
29882
+ query?: never;
29883
+ header?: never;
29884
+ path: {
29885
+ workspaceId: components["parameters"]["WorkspaceId"];
29886
+ };
29887
+ cookie?: never;
29888
+ };
29889
+ requestBody: {
29890
+ content: {
29891
+ "application/json": components["schemas"]["CodeChatFeedbackSettingsDto"];
29892
+ };
29893
+ };
29894
+ responses: {
29895
+ /** @description Settings after the change */
29896
+ 200: {
29897
+ headers: {
29898
+ [name: string]: unknown;
29899
+ };
29900
+ content: {
29901
+ "application/json": components["schemas"]["CodeChatFeedbackSettingsDto"];
29902
+ };
29903
+ };
29904
+ /** @description captureQuestions must be a boolean (`invalid_input`) */
29905
+ 400: {
29906
+ headers: {
29907
+ [name: string]: unknown;
29908
+ };
29909
+ content: {
29910
+ "application/json": components["schemas"]["ErrorMessageDto"];
29911
+ };
29912
+ };
29913
+ 401: components["responses"]["Unauthorized"];
29914
+ /** @description Workspace admin required */
29915
+ 403: {
29916
+ headers: {
29917
+ [name: string]: unknown;
29918
+ };
29919
+ content: {
29920
+ "application/json": components["schemas"]["ErrorMessageDto"];
29921
+ };
29922
+ };
29711
29923
  };
29712
29924
  };
29713
29925
  listCodeChatWikiPages: {