@pushwoosh/rpc-gateway-ai-assistant 0.1.197 → 0.1.199

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
@@ -2039,6 +2039,108 @@ export const data = {
2039
2039
  }
2040
2040
  }
2041
2041
  },
2042
+ "pushwoosh.accounts.assistant.v1.CreateRealtimeSessionRequest": {
2043
+ "type": "I",
2044
+ "fields": {
2045
+ "application": {
2046
+ "type": "string"
2047
+ },
2048
+ "provider": {
2049
+ "type": "string"
2050
+ },
2051
+ "chatId": {
2052
+ "type": "number"
2053
+ }
2054
+ }
2055
+ },
2056
+ "pushwoosh.accounts.assistant.v1.AppendVoiceTranscriptRequest": {
2057
+ "type": "I",
2058
+ "fields": {
2059
+ "application": {
2060
+ "type": "string"
2061
+ },
2062
+ "chatId": {
2063
+ "type": "number"
2064
+ },
2065
+ "role": {
2066
+ "type": "pushwoosh.accounts.assistant.v1.Role"
2067
+ },
2068
+ "text": {
2069
+ "type": "string"
2070
+ },
2071
+ "provider": {
2072
+ "type": "string"
2073
+ },
2074
+ "mattermostRootId": {
2075
+ "type": "string"
2076
+ }
2077
+ }
2078
+ },
2079
+ "pushwoosh.accounts.assistant.v1.AppendVoiceTranscriptResponse": {
2080
+ "type": "I",
2081
+ "fields": {
2082
+ "mattermostRootId": {
2083
+ "type": "string"
2084
+ }
2085
+ }
2086
+ },
2087
+ "pushwoosh.accounts.assistant.v1.CallVoiceToolRequest": {
2088
+ "type": "I",
2089
+ "fields": {
2090
+ "application": {
2091
+ "type": "string"
2092
+ },
2093
+ "name": {
2094
+ "type": "string"
2095
+ },
2096
+ "arguments": {
2097
+ "type": "string"
2098
+ }
2099
+ }
2100
+ },
2101
+ "pushwoosh.accounts.assistant.v1.CallVoiceToolResponse": {
2102
+ "type": "I",
2103
+ "fields": {
2104
+ "result": {
2105
+ "type": "string"
2106
+ }
2107
+ }
2108
+ },
2109
+ "pushwoosh.accounts.assistant.v1.VoiceTool": {
2110
+ "type": "I",
2111
+ "fields": {
2112
+ "name": {
2113
+ "type": "string"
2114
+ },
2115
+ "description": {
2116
+ "type": "string"
2117
+ },
2118
+ "parametersJsonSchema": {
2119
+ "type": "string"
2120
+ }
2121
+ }
2122
+ },
2123
+ "pushwoosh.accounts.assistant.v1.CreateRealtimeSessionResponse": {
2124
+ "type": "I",
2125
+ "fields": {
2126
+ "clientSecret": {
2127
+ "type": "string"
2128
+ },
2129
+ "model": {
2130
+ "type": "string"
2131
+ },
2132
+ "expiresAt": {
2133
+ "type": "Date"
2134
+ },
2135
+ "provider": {
2136
+ "type": "string"
2137
+ },
2138
+ "tools": {
2139
+ "type": "pushwoosh.accounts.assistant.v1.VoiceTool",
2140
+ "array": true
2141
+ }
2142
+ }
2143
+ },
2042
2144
  "pushwoosh.accounts.assistant.v1.AssistantService": {
2043
2145
  "type": "S",
2044
2146
  "key": "assistant",
@@ -2142,6 +2244,24 @@ export const data = {
2142
2244
  "response": "pushwoosh.accounts.assistant.v1.CompleteOnboardingHandoffResponse",
2143
2245
  "method": "post",
2144
2246
  "path": "/api/v1/applications/{application}/chats/{chat_id}/onboarding/handoff"
2247
+ },
2248
+ "CreateRealtimeSession": {
2249
+ "request": "pushwoosh.accounts.assistant.v1.CreateRealtimeSessionRequest",
2250
+ "response": "pushwoosh.accounts.assistant.v1.CreateRealtimeSessionResponse",
2251
+ "method": "post",
2252
+ "path": "/api/v1/applications/{application}/realtime/session"
2253
+ },
2254
+ "CallVoiceTool": {
2255
+ "request": "pushwoosh.accounts.assistant.v1.CallVoiceToolRequest",
2256
+ "response": "pushwoosh.accounts.assistant.v1.CallVoiceToolResponse",
2257
+ "method": "post",
2258
+ "path": "/api/v1/applications/{application}/realtime/tool-call"
2259
+ },
2260
+ "AppendVoiceTranscript": {
2261
+ "request": "pushwoosh.accounts.assistant.v1.AppendVoiceTranscriptRequest",
2262
+ "response": "pushwoosh.accounts.assistant.v1.AppendVoiceTranscriptResponse",
2263
+ "method": "post",
2264
+ "path": "/api/v1/applications/{application}/realtime/transcript"
2145
2265
  }
2146
2266
  }
2147
2267
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pushwoosh/rpc-gateway-ai-assistant",
3
- "version": "0.1.197",
3
+ "version": "0.1.199",
4
4
  "description": "AI Assistant api gateway HTTP API Types and Data",
5
5
  "main": "index.js",
6
6
  "module": "index.js",
@@ -251,6 +251,109 @@ export type CompleteOnboardingHandoffRequest = {
251
251
  export type CompleteOnboardingHandoffResponse = {
252
252
  chat: Chat;
253
253
  };
254
+ /**
255
+ * CreateRealtimeSessionRequest mints an ephemeral realtime voice secret
256
+ * (OpenAI Realtime over WebRTC or Gemini Live over WebSocket). The session
257
+ * configuration — instructions, memory, chat history, tools — is fixed
258
+ * server-side; the frontend only receives the short-lived secret.
259
+ */
260
+ export type CreateRealtimeSessionRequest = {
261
+ application: string;
262
+ /**
263
+ * provider selects the realtime backend: "gemini" (default) or "openai".
264
+ * Unknown values are rejected; a provider not enabled in config returns
265
+ * Unimplemented.
266
+ */
267
+ provider: string;
268
+ /**
269
+ * chat_id, when non-zero, injects the recent history of this chat into the
270
+ * voice instructions so the call continues the text conversation instead of
271
+ * starting cold. The chat must belong to the caller.
272
+ */
273
+ chatId: number;
274
+ };
275
+ /**
276
+ * AppendVoiceTranscriptRequest persists one completed voice turn into the
277
+ * chat and mirrors it to Mattermost with a voice marker. The browser sends a
278
+ * turn as soon as its transcription completes, so a dropped call loses at
279
+ * most the in-flight turn.
280
+ */
281
+ export type AppendVoiceTranscriptRequest = {
282
+ application: string;
283
+ /** chat the voice call is attached to */
284
+ chatId: number;
285
+ /** ROLE_USER or ROLE_ASSISTANT */
286
+ role: Role;
287
+ /** final transcript of the turn */
288
+ text: string;
289
+ /** "openai" | "gemini" — for the Mattermost voice marker */
290
+ provider: string;
291
+ /**
292
+ * Mattermost thread root of the current voice exchange: pass the value
293
+ * returned by the previous user turn so assistant replies thread under it.
294
+ */
295
+ mattermostRootId: string;
296
+ };
297
+ /**
298
+ * AppendVoiceTranscriptResponse returns the Mattermost thread root: user turns
299
+ * create it, assistant turns echo the request value back.
300
+ */
301
+ export type AppendVoiceTranscriptResponse = {
302
+ mattermostRootId: string;
303
+ };
304
+ /**
305
+ * CallVoiceToolRequest relays one tool call of a Gemini voice session. The
306
+ * Live API has no remote-MCP support, so the browser forwards the model's
307
+ * toolCall messages here; the allowlist is re-checked server-side and the call
308
+ * is proxied to the owning upstream MCP server.
309
+ */
310
+ export type CallVoiceToolRequest = {
311
+ application: string;
312
+ /** tool name exactly as declared to the model */
313
+ name: string;
314
+ /** JSON-encoded tool arguments from the model */
315
+ arguments: string;
316
+ };
317
+ /**
318
+ * CallVoiceToolResponse carries the raw MCP tool result as JSON; the browser
319
+ * passes it back to the model verbatim.
320
+ */
321
+ export type CallVoiceToolResponse = {
322
+ /** JSON-encoded MCP toolCallResult */
323
+ result: string;
324
+ };
325
+ /**
326
+ * VoiceTool is a tool declaration for a voice session. Declarations are
327
+ * built server-side from the realtime allowlist; the browser registers them
328
+ * with the provider SDK and relays execution through CallVoiceTool.
329
+ */
330
+ export type VoiceTool = {
331
+ name: string;
332
+ description: string;
333
+ /** JSON-encoded input schema */
334
+ parametersJsonSchema: string;
335
+ };
336
+ /**
337
+ * CreateRealtimeSessionResponse carries the ephemeral secret. The secret is
338
+ * single-session and expires within minutes — the frontend must request a
339
+ * fresh one for every call and never persist it.
340
+ */
341
+ export type CreateRealtimeSessionResponse = {
342
+ /** OpenAI: "ek_..." / Gemini: "auth_tokens/..." */
343
+ clientSecret: string;
344
+ /** realtime model the session is pinned to */
345
+ model: string;
346
+ /** secret expiration */
347
+ expiresAt: Date;
348
+ /** provider the secret belongs to */
349
+ provider: string;
350
+ /**
351
+ * Tool declarations the browser must register with the provider SDK
352
+ * (execution relays through CallVoiceTool). Empty for Gemini: its
353
+ * declarations are pinned inside the ephemeral token's constraints.
354
+ */
355
+ tools: VoiceTool[];
356
+ };
254
357
  export type AssistantService_CreateChat = RpcMethod<CreateChatRequest, CreateChatResponse>;
255
358
  export type AssistantService_GetChat = RpcMethod<GetChatRequest, GetChatResponse>;
256
359
  export type AssistantService_GetAllChats = RpcMethod<GetAllChatsRequest, GetAllChatsResponse>;
@@ -263,6 +366,9 @@ export type AssistantService_CompactifyContext = RpcMethod<CompactifyContextRequ
263
366
  export type AssistantService_CheckUsageAllowed = RpcMethod<CheckUsageAllowedRequest, CheckUsageAllowedResponse>;
264
367
  export type AssistantService_GetOnboardingStatus = RpcMethod<GetOnboardingStatusRequest, GetOnboardingStatusResponse>;
265
368
  export type AssistantService_CompleteOnboardingHandoff = RpcMethod<CompleteOnboardingHandoffRequest, CompleteOnboardingHandoffResponse>;
369
+ export type AssistantService_CreateRealtimeSession = RpcMethod<CreateRealtimeSessionRequest, CreateRealtimeSessionResponse>;
370
+ export type AssistantService_CallVoiceTool = RpcMethod<CallVoiceToolRequest, CallVoiceToolResponse>;
371
+ export type AssistantService_AppendVoiceTranscript = RpcMethod<AppendVoiceTranscriptRequest, AppendVoiceTranscriptResponse>;
266
372
  export interface AssistantService {
267
373
  /** Create a new chat */
268
374
  CreateChat: AssistantService_CreateChat;
@@ -315,4 +421,22 @@ export interface AssistantService {
315
421
  * on chat reload).
316
422
  */
317
423
  CompleteOnboardingHandoff: AssistantService_CompleteOnboardingHandoff;
424
+ /**
425
+ * CreateRealtimeSession mints an ephemeral voice-session secret for the
426
+ * configured provider (OpenAI or Gemini). Auth, usage quota and session
427
+ * configuration are enforced here; provider API keys never reach the browser.
428
+ */
429
+ CreateRealtimeSession: AssistantService_CreateRealtimeSession;
430
+ /**
431
+ * CallVoiceTool relays a Gemini voice session's tool call to the MCP proxy
432
+ * upstreams, enforcing the realtime allowlist. Used only by the voice
433
+ * widget; OpenAI sessions call the MCP proxy directly instead.
434
+ */
435
+ CallVoiceTool: AssistantService_CallVoiceTool;
436
+ /**
437
+ * AppendVoiceTranscript persists one completed voice turn into the chat and
438
+ * mirrors it to Mattermost (marked as voice). Called by the voice widget as
439
+ * turns finish, so voice conversations are logged like text ones.
440
+ */
441
+ AppendVoiceTranscript: AssistantService_AppendVoiceTranscript;
318
442
  }