@pushwoosh/rpc-gateway-ai-assistant 0.1.448 → 0.1.449

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
@@ -3522,7 +3522,8 @@ export const data = {
3522
3522
  "ROLE_ASSISTANT",
3523
3523
  "ROLE_TOOL_REQUEST",
3524
3524
  "ROLE_TOOL_USE_RESPONSE",
3525
- "ROLE_CONTEXT_COMPACTIFIED"
3525
+ "ROLE_CONTEXT_COMPACTIFIED",
3526
+ "ROLE_PROPOSAL_RESULT"
3526
3527
  ]
3527
3528
  },
3528
3529
  "pushwoosh.accounts.assistant.v1.Message": {
@@ -3804,7 +3805,9 @@ export const data = {
3804
3805
  "STREAM_EVENT_TOOL_USE_DELTA",
3805
3806
  "STREAM_EVENT_THINKING_DELTA",
3806
3807
  "STREAM_EVENT_SUGGESTED_ACTIONS",
3807
- "STREAM_EVENT_RELOAD_VIEW"
3808
+ "STREAM_EVENT_RELOAD_VIEW",
3809
+ "STREAM_EVENT_PROPOSAL",
3810
+ "STREAM_EVENT_TOOL_REQUEST_SAVED"
3808
3811
  ]
3809
3812
  },
3810
3813
  "pushwoosh.accounts.assistant.v1.ReloadView": {
@@ -3885,6 +3888,12 @@ export const data = {
3885
3888
  },
3886
3889
  "eventId": {
3887
3890
  "type": "string"
3891
+ },
3892
+ "proposal": {
3893
+ "type": "pushwoosh.accounts.assistant.v1.Proposal"
3894
+ },
3895
+ "toolRequestMessageId": {
3896
+ "type": "number"
3888
3897
  }
3889
3898
  }
3890
3899
  },
@@ -4100,6 +4109,139 @@ export const data = {
4100
4109
  }
4101
4110
  }
4102
4111
  },
4112
+ "pushwoosh.accounts.assistant.v1.Proposal": {
4113
+ "type": "I",
4114
+ "fields": {
4115
+ "id": {
4116
+ "type": "number"
4117
+ },
4118
+ "chatId": {
4119
+ "type": "number"
4120
+ },
4121
+ "messageId": {
4122
+ "type": "number"
4123
+ },
4124
+ "toolCallId": {
4125
+ "type": "string"
4126
+ },
4127
+ "toolCallName": {
4128
+ "type": "string"
4129
+ },
4130
+ "toolCallArgs": {
4131
+ "type": "string"
4132
+ },
4133
+ "title": {
4134
+ "type": "string"
4135
+ },
4136
+ "reason": {
4137
+ "type": "string"
4138
+ },
4139
+ "audienceCalculationStatus": {
4140
+ "type": "string"
4141
+ },
4142
+ "audienceSize": {
4143
+ "type": "number"
4144
+ },
4145
+ "status": {
4146
+ "type": "string"
4147
+ },
4148
+ "expiresAt": {
4149
+ "type": "Date"
4150
+ },
4151
+ "userId": {
4152
+ "type": "number"
4153
+ },
4154
+ "userEmail": {
4155
+ "type": "string"
4156
+ },
4157
+ "decidedBy": {
4158
+ "type": "number"
4159
+ },
4160
+ "decidedByEmail": {
4161
+ "type": "string"
4162
+ },
4163
+ "decidedAt": {
4164
+ "type": "Date"
4165
+ },
4166
+ "toolCallResult": {
4167
+ "type": "string"
4168
+ },
4169
+ "toolCallResultRef": {
4170
+ "type": "string"
4171
+ },
4172
+ "inferencePath": {
4173
+ "type": "string"
4174
+ },
4175
+ "createdAt": {
4176
+ "type": "Date"
4177
+ }
4178
+ }
4179
+ },
4180
+ "pushwoosh.accounts.assistant.v1.ListProposalsRequest": {
4181
+ "type": "I",
4182
+ "fields": {
4183
+ "application": {
4184
+ "type": "string"
4185
+ },
4186
+ "chatId": {
4187
+ "type": "number"
4188
+ },
4189
+ "status": {
4190
+ "type": "string"
4191
+ }
4192
+ }
4193
+ },
4194
+ "pushwoosh.accounts.assistant.v1.ListProposalsResponse": {
4195
+ "type": "I",
4196
+ "fields": {
4197
+ "proposals": {
4198
+ "type": "pushwoosh.accounts.assistant.v1.Proposal",
4199
+ "array": true
4200
+ }
4201
+ }
4202
+ },
4203
+ "pushwoosh.accounts.assistant.v1.CountPendingProposalsRequest": {
4204
+ "type": "I",
4205
+ "fields": {
4206
+ "application": {
4207
+ "type": "string"
4208
+ }
4209
+ }
4210
+ },
4211
+ "pushwoosh.accounts.assistant.v1.CountPendingProposalsResponse": {
4212
+ "type": "I",
4213
+ "fields": {
4214
+ "count": {
4215
+ "type": "number"
4216
+ }
4217
+ }
4218
+ },
4219
+ "pushwoosh.accounts.assistant.v1.ProposalDecision": {
4220
+ "type": "I",
4221
+ "fields": {
4222
+ "proposalId": {
4223
+ "type": "number"
4224
+ },
4225
+ "accept": {
4226
+ "type": "boolean"
4227
+ }
4228
+ }
4229
+ },
4230
+ "pushwoosh.accounts.assistant.v1.DecideProposalsRequest": {
4231
+ "type": "I",
4232
+ "fields": {
4233
+ "application": {
4234
+ "type": "string"
4235
+ },
4236
+ "chatId": {
4237
+ "type": "number"
4238
+ },
4239
+ "decisions": {
4240
+ "type": "pushwoosh.accounts.assistant.v1.ProposalDecision",
4241
+ "array": true
4242
+ }
4243
+ }
4244
+ },
4103
4245
  "pushwoosh.accounts.assistant.v1.AssistantService": {
4104
4246
  "type": "S",
4105
4247
  "key": "assistant",
@@ -4181,6 +4323,46 @@ export const data = {
4181
4323
  "path": "/api/v1/chats/{chat_id}/inference/stream-llm",
4182
4324
  "serverStreaming": true
4183
4325
  },
4326
+ "ListProposals": {
4327
+ "request": "pushwoosh.accounts.assistant.v1.ListProposalsRequest",
4328
+ "response": "pushwoosh.accounts.assistant.v1.ListProposalsResponse",
4329
+ "method": "get",
4330
+ "path": "/api/v1/applications/{application}/proposals"
4331
+ },
4332
+ "CountPendingProposals": {
4333
+ "request": "pushwoosh.accounts.assistant.v1.CountPendingProposalsRequest",
4334
+ "response": "pushwoosh.accounts.assistant.v1.CountPendingProposalsResponse",
4335
+ "method": "get",
4336
+ "path": "/api/v1/applications/{application}/proposals/pending-count"
4337
+ },
4338
+ "DecideProposals": {
4339
+ "request": "pushwoosh.accounts.assistant.v1.DecideProposalsRequest",
4340
+ "response": "pushwoosh.accounts.assistant.v1.InferenceResponse",
4341
+ "method": "post",
4342
+ "path": "/api/v1/applications/{application}/chats/{chat_id}/proposals/decide",
4343
+ "serverStreaming": true
4344
+ },
4345
+ "DecideProposalsGemini": {
4346
+ "request": "pushwoosh.accounts.assistant.v1.DecideProposalsRequest",
4347
+ "response": "pushwoosh.accounts.assistant.v1.InferenceResponse",
4348
+ "method": "post",
4349
+ "path": "/api/v1/applications/{application}/chats/{chat_id}/proposals/decide-gemini",
4350
+ "serverStreaming": true
4351
+ },
4352
+ "DecideProposalsLLM": {
4353
+ "request": "pushwoosh.accounts.assistant.v1.DecideProposalsRequest",
4354
+ "response": "pushwoosh.accounts.assistant.v1.InferenceResponse",
4355
+ "method": "post",
4356
+ "path": "/api/v1/applications/{application}/chats/{chat_id}/proposals/decide-llm",
4357
+ "serverStreaming": true
4358
+ },
4359
+ "DecideProposalsChatGPT": {
4360
+ "request": "pushwoosh.accounts.assistant.v1.DecideProposalsRequest",
4361
+ "response": "pushwoosh.accounts.assistant.v1.InferenceResponse",
4362
+ "method": "post",
4363
+ "path": "/api/v1/applications/{application}/chats/{chat_id}/proposals/decide-chatgpt",
4364
+ "serverStreaming": true
4365
+ },
4184
4366
  "GetConsent": {
4185
4367
  "request": "pushwoosh.accounts.assistant.v1.GetConsentRequest",
4186
4368
  "response": "pushwoosh.accounts.assistant.v1.GetConsentResponse",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pushwoosh/rpc-gateway-ai-assistant",
3
- "version": "0.1.448",
3
+ "version": "0.1.449",
4
4
  "description": "AI Assistant api gateway HTTP API Types and Data",
5
5
  "main": "index.js",
6
6
  "module": "index.js",
@@ -6,7 +6,9 @@ export type Role = 'ROLE_UNSPECIFIED' | 'ROLE_USER' | 'ROLE_ASSISTANT'
6
6
  /** Function/tool response */
7
7
  | 'ROLE_TOOL_USE_RESPONSE'
8
8
  /** Compactified context summary */
9
- | 'ROLE_CONTEXT_COMPACTIFIED';
9
+ | 'ROLE_CONTEXT_COMPACTIFIED'
10
+ /** Outcome of the user's decision on tool-call proposals; JSON content */
11
+ | 'ROLE_PROPOSAL_RESULT';
10
12
  /** Message represents a single message in a chat */
11
13
  export type Message = {
12
14
  id: number;
@@ -183,7 +185,11 @@ export type StreamEventType = 'STREAM_EVENT_UNSPECIFIED' | 'STREAM_EVENT_MESSAGE
183
185
  /** Model-proposed follow-up actions for the user */
184
186
  | 'STREAM_EVENT_SUGGESTED_ACTIONS'
185
187
  /** An assistant tool call mutated data an open view may be showing — reload it. See ReloadView. */
186
- | 'STREAM_EVENT_RELOAD_VIEW';
188
+ | 'STREAM_EVENT_RELOAD_VIEW'
189
+ /** A tool call became a proposal, or a proposal changed status. See Proposal. */
190
+ | 'STREAM_EVENT_PROPOSAL'
191
+ /** The turn's tool calls landed in one row; see tool_request_message_id. */
192
+ | 'STREAM_EVENT_TOOL_REQUEST_SAVED';
187
193
  /**
188
194
  * ReloadView tells the frontend that a tool call mutated data, so an open
189
195
  * view showing it should re-fetch (views listen for a "reload-view" event on
@@ -224,6 +230,10 @@ export type InferenceResponse = {
224
230
  reloadView: ReloadView;
225
231
  /** Set by AttachTurn; pass the last one back as after_event_id to resume */
226
232
  eventId: string;
233
+ /** Set on STREAM_EVENT_PROPOSAL */
234
+ proposal: Proposal;
235
+ /** Set on STREAM_EVENT_TOOL_REQUEST_SAVED */
236
+ toolRequestMessageId: number;
227
237
  };
228
238
  export type GetConsentRequest = {
229
239
  application: string;
@@ -403,6 +413,68 @@ export type CreateRealtimeSessionResponse = {
403
413
  */
404
414
  tools: VoiceTool[];
405
415
  };
416
+ /** A gated tool call awaiting a human decision; field names match the ai_assistant_chat_proposals columns. */
417
+ export type Proposal = {
418
+ id: number;
419
+ chatId: number;
420
+ /** tool_request row the call came from; the card groups by it */
421
+ messageId: number;
422
+ toolCallId: string;
423
+ /** canonical tool name */
424
+ toolCallName: string;
425
+ /** JSON object */
426
+ toolCallArgs: string;
427
+ title: string;
428
+ reason: string;
429
+ /** na | preparing | ready | failed */
430
+ audienceCalculationStatus: string;
431
+ /** meaningful only when audience_calculation_status == ready */
432
+ audienceSize: number;
433
+ /** preparing | pending | accepted | executing | executed | failed | rejected | expired */
434
+ status: string;
435
+ expiresAt: Date;
436
+ /** who chatted */
437
+ userId: number;
438
+ userEmail: string;
439
+ /** 0 means nobody decided yet: the column is NULL, flattened here */
440
+ decidedBy: number;
441
+ decidedByEmail: string;
442
+ decidedAt: Date;
443
+ /** truncated tool result after execution */
444
+ toolCallResult: string;
445
+ /** id / code the upstream returned */
446
+ toolCallResultRef: string;
447
+ /** claude | gemini | chatgpt | llm | runner */
448
+ inferencePath: string;
449
+ createdAt: Date;
450
+ };
451
+ export type ListProposalsRequest = {
452
+ application: string;
453
+ /** 0 = every chat of the application */
454
+ chatId: number;
455
+ /** empty = any status */
456
+ status: string;
457
+ };
458
+ export type ListProposalsResponse = {
459
+ proposals: Proposal[];
460
+ };
461
+ export type CountPendingProposalsRequest = {
462
+ /** routing only: the count is per account */
463
+ application: string;
464
+ };
465
+ export type CountPendingProposalsResponse = {
466
+ count: number;
467
+ };
468
+ export type ProposalDecision = {
469
+ proposalId: number;
470
+ accept: boolean;
471
+ };
472
+ /** Decides a whole card at once: every pending proposal of that tool_request row not listed here is rejected. */
473
+ export type DecideProposalsRequest = {
474
+ application: string;
475
+ chatId: number;
476
+ decisions: ProposalDecision[];
477
+ };
406
478
  export type AssistantService_CreateChat = RpcMethod<CreateChatRequest, CreateChatResponse>;
407
479
  export type AssistantService_GetChat = RpcMethod<GetChatRequest, GetChatResponse>;
408
480
  export type AssistantService_GetAllChats = RpcMethod<GetAllChatsRequest, GetAllChatsResponse>;
@@ -410,6 +482,8 @@ export type AssistantService_UpdateChatTitle = RpcMethod<UpdateChatTitleRequest,
410
482
  export type AssistantService_DeleteChat = RpcMethod<DeleteChatRequest, DeleteChatResponse>;
411
483
  export type AssistantService_ClearChat = RpcMethod<ClearChatRequest, ClearChatResponse>;
412
484
  export type AssistantService_CancelTurn = RpcMethod<CancelTurnRequest, CancelTurnResponse>;
485
+ export type AssistantService_ListProposals = RpcMethod<ListProposalsRequest, ListProposalsResponse>;
486
+ export type AssistantService_CountPendingProposals = RpcMethod<CountPendingProposalsRequest, CountPendingProposalsResponse>;
413
487
  export type AssistantService_GetConsent = RpcMethod<GetConsentRequest, GetConsentResponse>;
414
488
  export type AssistantService_GiveConsent = RpcMethod<GiveConsentRequest, GiveConsentResponse>;
415
489
  export type AssistantService_CompactifyContext = RpcMethod<CompactifyContextRequest, CompactifyContextResponse>;
@@ -464,6 +538,21 @@ export interface AssistantService {
464
538
  StreamInferenceLLM(request: InferenceRequest, options?: {
465
539
  signal?: AbortSignal;
466
540
  }): Promise<AsyncIterable<InferenceResponse>>;
541
+ ListProposals: AssistantService_ListProposals;
542
+ CountPendingProposals: AssistantService_CountPendingProposals;
543
+ /** Applies decisions, executes accepted calls, writes a proposal_result row and continues the turn. */
544
+ DecideProposals(request: DecideProposalsRequest, options?: {
545
+ signal?: AbortSignal;
546
+ }): Promise<AsyncIterable<InferenceResponse>>;
547
+ DecideProposalsGemini(request: DecideProposalsRequest, options?: {
548
+ signal?: AbortSignal;
549
+ }): Promise<AsyncIterable<InferenceResponse>>;
550
+ DecideProposalsLLM(request: DecideProposalsRequest, options?: {
551
+ signal?: AbortSignal;
552
+ }): Promise<AsyncIterable<InferenceResponse>>;
553
+ DecideProposalsChatGPT(request: DecideProposalsRequest, options?: {
554
+ signal?: AbortSignal;
555
+ }): Promise<AsyncIterable<InferenceResponse>>;
467
556
  GetConsent: AssistantService_GetConsent;
468
557
  GiveConsent: AssistantService_GiveConsent;
469
558
  CompactifyContext: AssistantService_CompactifyContext;