@thinkai/tai-api-contract 2.256.0 → 2.257.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.256.0
4
+ version: 2.257.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}/...`.
@@ -12726,8 +12726,9 @@ paths:
12726
12726
  $ref: "#/components/schemas/ErrorMessageDto"
12727
12727
  "409":
12728
12728
  description: >
12729
- Chat not ready, no ready corpus in thread scope, or `continueAsk` expired /
12730
- mismatched (`continue_expired`).
12729
+ Chat not ready, no ready corpus in thread scope, `continueAsk` expired /
12730
+ mismatched (`continue_expired`), or this thread is still answering its last
12731
+ question (`ask_turn_in_progress`).
12731
12732
  content:
12732
12733
  application/json:
12733
12734
  schema:
@@ -12751,6 +12752,85 @@ paths:
12751
12752
  schema:
12752
12753
  $ref: "#/components/schemas/ErrorMessageDto"
12753
12754
 
12755
+ /workspaces/{workspaceId}/code-chat/threads/{threadId}/turn/stream:
12756
+ get:
12757
+ tags: [CodeChat]
12758
+ summary: Reattach to the Ask that is running on a thread
12759
+ description: >
12760
+ For a page that reloaded while an Ask was running. Replays the stages and answer text so
12761
+ far, then follows the turn live. Closing this stream does not stop the turn; use the
12762
+ cancel route. A few pages can follow one turn; past that the oldest is dropped. Runs on one replica: when the turn is not running there, the reply is JSON
12763
+ `{ running: false }` and the page reads the saved thread instead.
12764
+ operationId: streamCodeChatTurn
12765
+ x-test-coverage-skip: in-memory registry covered by ask-turn-registry.test
12766
+ parameters:
12767
+ - $ref: "#/components/parameters/WorkspaceId"
12768
+ - name: threadId
12769
+ in: path
12770
+ required: true
12771
+ schema: { type: string, format: uuid }
12772
+ responses:
12773
+ "200":
12774
+ description: >
12775
+ `text/event-stream` with `event: turn` (`{ startedAt }`), then `event: stage`
12776
+ (`{ stage, detail? }`), `event: token` (`{ text }`, the text so far, then new text),
12777
+ `event: reset` (`{}`), `event: error` (`{ error, code }`), and `event: done`
12778
+ (CodeChatMessageReplyDto). The stream ends after `done` or `error`, or without either
12779
+ when the turn was stopped or dropped this page; read the thread then.
12780
+ content:
12781
+ application/json:
12782
+ schema:
12783
+ type: object
12784
+ required: [running]
12785
+ properties:
12786
+ running: { type: boolean }
12787
+ text/event-stream:
12788
+ schema:
12789
+ type: string
12790
+ "401":
12791
+ $ref: "#/components/responses/Unauthorized"
12792
+ "404":
12793
+ description: Not found
12794
+ content:
12795
+ application/json:
12796
+ schema:
12797
+ $ref: "#/components/schemas/ErrorMessageDto"
12798
+
12799
+ /workspaces/{workspaceId}/code-chat/threads/{threadId}/cancel:
12800
+ post:
12801
+ tags: [CodeChat]
12802
+ summary: Stop the Ask that is running on a thread
12803
+ description: >
12804
+ An Ask keeps running when the reader's page closes or reloads. This is the Stop button.
12805
+ Runs on one replica; `cancelled` is false when no turn was running there, and the turn
12806
+ then ends at its time limit.
12807
+ operationId: cancelCodeChatTurn
12808
+ x-test-coverage-skip: in-memory registry covered by ask-turn-registry.test
12809
+ parameters:
12810
+ - $ref: "#/components/parameters/WorkspaceId"
12811
+ - name: threadId
12812
+ in: path
12813
+ required: true
12814
+ schema: { type: string, format: uuid }
12815
+ responses:
12816
+ "200":
12817
+ description: Stop was requested (or nothing was running)
12818
+ content:
12819
+ application/json:
12820
+ schema:
12821
+ type: object
12822
+ required: [cancelled]
12823
+ properties:
12824
+ cancelled: { type: boolean }
12825
+ "401":
12826
+ $ref: "#/components/responses/Unauthorized"
12827
+ "404":
12828
+ description: Not found
12829
+ content:
12830
+ application/json:
12831
+ schema:
12832
+ $ref: "#/components/schemas/ErrorMessageDto"
12833
+
12754
12834
  /workspaces/{workspaceId}/code-chat/threads/{threadId}/messages/{messageId}/feedback:
12755
12835
  post:
12756
12836
  tags: [CodeChat]
@@ -1201,6 +1201,16 @@
1201
1201
  "method": "POST",
1202
1202
  "path": "/workspaces/{workspaceId}/code-chat/threads/{threadId}/messages"
1203
1203
  },
1204
+ "streamCodeChatTurn": {
1205
+ "status": "implemented",
1206
+ "method": "GET",
1207
+ "path": "/workspaces/{workspaceId}/code-chat/threads/{threadId}/turn/stream"
1208
+ },
1209
+ "cancelCodeChatTurn": {
1210
+ "status": "implemented",
1211
+ "method": "POST",
1212
+ "path": "/workspaces/{workspaceId}/code-chat/threads/{threadId}/cancel"
1213
+ },
1204
1214
  "listCodeChatWikiPages": {
1205
1215
  "status": "implemented",
1206
1216
  "method": "GET",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thinkai/tai-api-contract",
3
- "version": "2.256.0",
3
+ "version": "2.257.0",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -4616,6 +4616,46 @@ export interface paths {
4616
4616
  patch?: never;
4617
4617
  trace?: never;
4618
4618
  };
4619
+ "/workspaces/{workspaceId}/code-chat/threads/{threadId}/turn/stream": {
4620
+ parameters: {
4621
+ query?: never;
4622
+ header?: never;
4623
+ path?: never;
4624
+ cookie?: never;
4625
+ };
4626
+ /**
4627
+ * Reattach to the Ask that is running on a thread
4628
+ * @description For a page that reloaded while an Ask was running. Replays the stages and answer text so far, then follows the turn live. Closing this stream does not stop the turn; use the cancel route. A few pages can follow one turn; past that the oldest is dropped. Runs on one replica: when the turn is not running there, the reply is JSON `{ running: false }` and the page reads the saved thread instead.
4629
+ */
4630
+ get: operations["streamCodeChatTurn"];
4631
+ put?: never;
4632
+ post?: never;
4633
+ delete?: never;
4634
+ options?: never;
4635
+ head?: never;
4636
+ patch?: never;
4637
+ trace?: never;
4638
+ };
4639
+ "/workspaces/{workspaceId}/code-chat/threads/{threadId}/cancel": {
4640
+ parameters: {
4641
+ query?: never;
4642
+ header?: never;
4643
+ path?: never;
4644
+ cookie?: never;
4645
+ };
4646
+ get?: never;
4647
+ put?: never;
4648
+ /**
4649
+ * Stop the Ask that is running on a thread
4650
+ * @description An Ask keeps running when the reader's page closes or reloads. This is the Stop button. Runs on one replica; `cancelled` is false when no turn was running there, and the turn then ends at its time limit.
4651
+ */
4652
+ post: operations["cancelCodeChatTurn"];
4653
+ delete?: never;
4654
+ options?: never;
4655
+ head?: never;
4656
+ patch?: never;
4657
+ trace?: never;
4658
+ };
4619
4659
  "/workspaces/{workspaceId}/code-chat/threads/{threadId}/messages/{messageId}/feedback": {
4620
4660
  parameters: {
4621
4661
  query?: never;
@@ -29777,7 +29817,7 @@ export interface operations {
29777
29817
  "application/json": components["schemas"]["ErrorMessageDto"];
29778
29818
  };
29779
29819
  };
29780
- /** @description Chat not ready, no ready corpus in thread scope, or `continueAsk` expired / mismatched (`continue_expired`). */
29820
+ /** @description Chat not ready, no ready corpus in thread scope, `continueAsk` expired / mismatched (`continue_expired`), or this thread is still answering its last question (`ask_turn_in_progress`). */
29781
29821
  409: {
29782
29822
  headers: {
29783
29823
  [name: string]: unknown;
@@ -29807,6 +29847,77 @@ export interface operations {
29807
29847
  };
29808
29848
  };
29809
29849
  };
29850
+ streamCodeChatTurn: {
29851
+ parameters: {
29852
+ query?: never;
29853
+ header?: never;
29854
+ path: {
29855
+ workspaceId: components["parameters"]["WorkspaceId"];
29856
+ threadId: string;
29857
+ };
29858
+ cookie?: never;
29859
+ };
29860
+ requestBody?: never;
29861
+ responses: {
29862
+ /** @description `text/event-stream` with `event: turn` (`{ startedAt }`), then `event: stage` (`{ stage, detail? }`), `event: token` (`{ text }`, the text so far, then new text), `event: reset` (`{}`), `event: error` (`{ error, code }`), and `event: done` (CodeChatMessageReplyDto). The stream ends after `done` or `error`, or without either when the turn was stopped or dropped this page; read the thread then. */
29863
+ 200: {
29864
+ headers: {
29865
+ [name: string]: unknown;
29866
+ };
29867
+ content: {
29868
+ "application/json": {
29869
+ running: boolean;
29870
+ };
29871
+ "text/event-stream": string;
29872
+ };
29873
+ };
29874
+ 401: components["responses"]["Unauthorized"];
29875
+ /** @description Not found */
29876
+ 404: {
29877
+ headers: {
29878
+ [name: string]: unknown;
29879
+ };
29880
+ content: {
29881
+ "application/json": components["schemas"]["ErrorMessageDto"];
29882
+ };
29883
+ };
29884
+ };
29885
+ };
29886
+ cancelCodeChatTurn: {
29887
+ parameters: {
29888
+ query?: never;
29889
+ header?: never;
29890
+ path: {
29891
+ workspaceId: components["parameters"]["WorkspaceId"];
29892
+ threadId: string;
29893
+ };
29894
+ cookie?: never;
29895
+ };
29896
+ requestBody?: never;
29897
+ responses: {
29898
+ /** @description Stop was requested (or nothing was running) */
29899
+ 200: {
29900
+ headers: {
29901
+ [name: string]: unknown;
29902
+ };
29903
+ content: {
29904
+ "application/json": {
29905
+ cancelled: boolean;
29906
+ };
29907
+ };
29908
+ };
29909
+ 401: components["responses"]["Unauthorized"];
29910
+ /** @description Not found */
29911
+ 404: {
29912
+ headers: {
29913
+ [name: string]: unknown;
29914
+ };
29915
+ content: {
29916
+ "application/json": components["schemas"]["ErrorMessageDto"];
29917
+ };
29918
+ };
29919
+ };
29920
+ };
29810
29921
  postCodeChatMessageFeedback: {
29811
29922
  parameters: {
29812
29923
  query?: never;