@pushwoosh/rpc-gateway-ai-assistant 0.1.431 → 0.1.433

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.
package/data.js CHANGED
@@ -3523,6 +3523,12 @@ export const data = {
3523
3523
  },
3524
3524
  "handoffChildChatId": {
3525
3525
  "type": "number"
3526
+ },
3527
+ "activeTurnId": {
3528
+ "type": "string"
3529
+ },
3530
+ "turnUserMessageId": {
3531
+ "type": "number"
3526
3532
  }
3527
3533
  }
3528
3534
  },
@@ -3637,6 +3643,39 @@ export const data = {
3637
3643
  }
3638
3644
  }
3639
3645
  },
3646
+ "pushwoosh.accounts.assistant.v1.CancelTurnRequest": {
3647
+ "type": "I",
3648
+ "fields": {
3649
+ "application": {
3650
+ "type": "string"
3651
+ },
3652
+ "chatId": {
3653
+ "type": "number"
3654
+ }
3655
+ }
3656
+ },
3657
+ "pushwoosh.accounts.assistant.v1.CancelTurnResponse": {
3658
+ "type": "I",
3659
+ "fields": {
3660
+ "cancelled": {
3661
+ "type": "boolean"
3662
+ }
3663
+ }
3664
+ },
3665
+ "pushwoosh.accounts.assistant.v1.AttachTurnRequest": {
3666
+ "type": "I",
3667
+ "fields": {
3668
+ "chatId": {
3669
+ "type": "number"
3670
+ },
3671
+ "turnId": {
3672
+ "type": "string"
3673
+ },
3674
+ "afterEventId": {
3675
+ "type": "string"
3676
+ }
3677
+ }
3678
+ },
3640
3679
  "pushwoosh.accounts.assistant.v1.FileAttachment": {
3641
3680
  "type": "I",
3642
3681
  "fields": {
@@ -3767,6 +3806,9 @@ export const data = {
3767
3806
  },
3768
3807
  "reloadView": {
3769
3808
  "type": "pushwoosh.accounts.assistant.v1.ReloadView"
3809
+ },
3810
+ "eventId": {
3811
+ "type": "string"
3770
3812
  }
3771
3813
  }
3772
3814
  },
@@ -4022,6 +4064,19 @@ export const data = {
4022
4064
  "method": "delete",
4023
4065
  "path": "/api/v1/applications/{application}/chats/{id}/messages"
4024
4066
  },
4067
+ "CancelTurn": {
4068
+ "request": "pushwoosh.accounts.assistant.v1.CancelTurnRequest",
4069
+ "response": "pushwoosh.accounts.assistant.v1.CancelTurnResponse",
4070
+ "method": "post",
4071
+ "path": "/api/v1/applications/{application}/chats/{chat_id}/turn/cancel"
4072
+ },
4073
+ "AttachTurn": {
4074
+ "request": "pushwoosh.accounts.assistant.v1.AttachTurnRequest",
4075
+ "response": "pushwoosh.accounts.assistant.v1.InferenceResponse",
4076
+ "method": "post",
4077
+ "path": "/api/v1/chats/{chat_id}/turn/attach",
4078
+ "serverStreaming": true
4079
+ },
4025
4080
  "StreamInference": {
4026
4081
  "request": "pushwoosh.accounts.assistant.v1.InferenceRequest",
4027
4082
  "response": "pushwoosh.accounts.assistant.v1.InferenceResponse",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pushwoosh/rpc-gateway-ai-assistant",
3
- "version": "0.1.431",
3
+ "version": "0.1.433",
4
4
  "description": "AI Assistant api gateway HTTP API Types and Data",
5
5
  "main": "index.js",
6
6
  "module": "index.js",
@@ -65,6 +65,16 @@ export type Chat = {
65
65
  * and return that chat. Zero means no handoff yet.
66
66
  */
67
67
  handoffChildChatId: number;
68
+ /**
69
+ * active_turn_id names the turn still answering in this chat, empty when none is. Follow it
70
+ * with AttachTurn; the chat stays busy until it ends.
71
+ */
72
+ activeTurnId: string;
73
+ /**
74
+ * turn_user_message_id is the running turn's user message (GetChat only). Messages after it
75
+ * belong to that turn and arrive through AttachTurn; 0 means it has not written one yet.
76
+ */
77
+ turnUserMessageId: number;
68
78
  };
69
79
  /** CreateChatRequest for creating a new chat */
70
80
  export type CreateChatRequest = {
@@ -124,6 +134,23 @@ export type ClearChatRequest = {
124
134
  export type ClearChatResponse = {
125
135
  success: boolean;
126
136
  };
137
+ /** CancelTurnRequest stops the turn running in a chat, on whichever pod it runs. */
138
+ export type CancelTurnRequest = {
139
+ application: string;
140
+ chatId: number;
141
+ };
142
+ /** CancelTurnResponse.cancelled is false when the chat had no turn running. */
143
+ export type CancelTurnResponse = {
144
+ cancelled: boolean;
145
+ };
146
+ /** AttachTurnRequest follows a running turn — from its start, or after the last event seen. */
147
+ export type AttachTurnRequest = {
148
+ chatId: number;
149
+ /** Chat.active_turn_id */
150
+ turnId: string;
151
+ /** InferenceResponse.event_id of the last event seen; empty replays all */
152
+ afterEventId: string;
153
+ };
127
154
  /** FileAttachment represents a file uploaded by the user */
128
155
  export type FileAttachment = {
129
156
  filename: string;
@@ -190,6 +217,8 @@ export type InferenceResponse = {
190
217
  actions: SuggestedAction[];
191
218
  /** Set on STREAM_EVENT_RELOAD_VIEW */
192
219
  reloadView: ReloadView;
220
+ /** Set by AttachTurn; pass the last one back as after_event_id to resume */
221
+ eventId: string;
193
222
  };
194
223
  export type GetConsentRequest = {
195
224
  application: string;
@@ -375,6 +404,7 @@ export type AssistantService_GetAllChats = RpcMethod<GetAllChatsRequest, GetAllC
375
404
  export type AssistantService_UpdateChatTitle = RpcMethod<UpdateChatTitleRequest, UpdateChatTitleResponse>;
376
405
  export type AssistantService_DeleteChat = RpcMethod<DeleteChatRequest, DeleteChatResponse>;
377
406
  export type AssistantService_ClearChat = RpcMethod<ClearChatRequest, ClearChatResponse>;
407
+ export type AssistantService_CancelTurn = RpcMethod<CancelTurnRequest, CancelTurnResponse>;
378
408
  export type AssistantService_GetConsent = RpcMethod<GetConsentRequest, GetConsentResponse>;
379
409
  export type AssistantService_GiveConsent = RpcMethod<GiveConsentRequest, GiveConsentResponse>;
380
410
  export type AssistantService_CompactifyContext = RpcMethod<CompactifyContextRequest, CompactifyContextResponse>;
@@ -397,6 +427,18 @@ export interface AssistantService {
397
427
  DeleteChat: AssistantService_DeleteChat;
398
428
  /** Clear all messages from a chat */
399
429
  ClearChat: AssistantService_ClearChat;
430
+ /**
431
+ * Stop the turn running in a chat. A turn outlives its stream for accounts on the
432
+ * detached-turns flag, so closing the stream no longer stops it.
433
+ */
434
+ CancelTurn: AssistantService_CancelTurn;
435
+ /**
436
+ * Follow a turn still answering; ends with the turn's own status. NotFound: its events expired,
437
+ * Aborted: its pod died, FailedPrecondition: too long to follow live — reload the chat.
438
+ */
439
+ AttachTurn(request: AttachTurnRequest, options?: {
440
+ signal?: AbortSignal;
441
+ }): Promise<AsyncIterable<InferenceResponse>>;
400
442
  /** Stream AI inference responses */
401
443
  StreamInference(request: InferenceRequest, options?: {
402
444
  signal?: AbortSignal;