mavenagi 1.2.67 → 1.2.69

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.
Files changed (156) hide show
  1. package/BaseClient.js +2 -2
  2. package/api/resources/actions/client/Client.d.ts +14 -0
  3. package/api/resources/actions/client/Client.js +14 -0
  4. package/api/resources/agents/client/Client.d.ts +10 -12
  5. package/api/resources/agents/client/Client.js +10 -12
  6. package/api/resources/analytics/client/Client.d.ts +10 -0
  7. package/api/resources/analytics/client/Client.js +10 -0
  8. package/api/resources/appDirectory/client/Client.d.ts +3 -1
  9. package/api/resources/appDirectory/client/Client.js +3 -1
  10. package/api/resources/assets/client/Client.d.ts +4 -0
  11. package/api/resources/assets/client/Client.js +4 -0
  12. package/api/resources/capabilities/client/Client.d.ts +20 -0
  13. package/api/resources/capabilities/client/Client.js +20 -0
  14. package/api/resources/capabilities/client/requests/CapabilityExecutionsSearchRequest.d.ts +4 -0
  15. package/api/resources/charters/client/Client.d.ts +18 -0
  16. package/api/resources/charters/client/Client.js +18 -0
  17. package/api/resources/commons/types/MetadataComparisonOperator.d.ts +4 -4
  18. package/api/resources/commons/types/MetadataComparisonOperator.js +4 -4
  19. package/api/resources/commons/types/MetadataConversationValueFilter.d.ts +1 -1
  20. package/api/resources/commons/types/MetadataFilter.d.ts +6 -1
  21. package/api/resources/commons/types/SimulationContext.d.ts +9 -0
  22. package/api/resources/commons/types/SystemEventName.d.ts +3 -0
  23. package/api/resources/commons/types/SystemEventName.js +3 -0
  24. package/api/resources/conversation/client/Client.d.ts +42 -3
  25. package/api/resources/conversation/client/Client.js +42 -3
  26. package/api/resources/conversation/types/AskRequest.d.ts +1 -62
  27. package/api/resources/conversation/types/AskRequestBase.d.ts +67 -0
  28. package/api/resources/conversation/types/index.d.ts +1 -0
  29. package/api/resources/conversation/types/index.js +1 -0
  30. package/api/resources/conversationKickoffs/client/Client.d.ts +2 -0
  31. package/api/resources/conversationKickoffs/client/Client.js +2 -0
  32. package/api/resources/customers/client/Client.d.ts +14 -0
  33. package/api/resources/customers/client/Client.js +14 -0
  34. package/api/resources/events/client/Client.d.ts +16 -3
  35. package/api/resources/events/client/Client.js +16 -3
  36. package/api/resources/inbox/client/Client.d.ts +20 -0
  37. package/api/resources/inbox/client/Client.js +20 -0
  38. package/api/resources/intelligentFields/client/Client.d.ts +10 -0
  39. package/api/resources/intelligentFields/client/Client.js +10 -0
  40. package/api/resources/intelligentFields/client/requests/IntelligentFieldPatchRequest.d.ts +1 -1
  41. package/api/resources/intelligentFields/types/IntelligentFieldCore.d.ts +2 -1
  42. package/api/resources/knowledge/client/Client.d.ts +40 -0
  43. package/api/resources/knowledge/client/Client.js +40 -0
  44. package/api/resources/knowledge/types/KnowledgeBaseFilter.d.ts +5 -1
  45. package/api/resources/knowledge/types/KnowledgeBaseIndexingStatus.d.ts +1 -1
  46. package/api/resources/knowledge/types/KnowledgeBaseIndexingStatus.js +1 -1
  47. package/api/resources/knowledge/types/KnowledgeBaseResponse.d.ts +3 -5
  48. package/api/resources/knowledge/types/KnowledgeBaseVersion.d.ts +1 -1
  49. package/api/resources/knowledge/types/KnowledgeDocumentMetadataValue.d.ts +4 -0
  50. package/api/resources/knowledge/types/KnowledgeDocumentRequest.d.ts +9 -3
  51. package/api/resources/knowledge/types/KnowledgeDocumentResponse.d.ts +2 -2
  52. package/api/resources/knowledge/types/index.d.ts +1 -0
  53. package/api/resources/knowledge/types/index.js +1 -0
  54. package/api/resources/segments/client/Client.d.ts +16 -0
  55. package/api/resources/segments/client/Client.js +16 -0
  56. package/api/resources/translations/client/Client.d.ts +2 -0
  57. package/api/resources/translations/client/Client.js +2 -0
  58. package/api/resources/triggers/client/Client.d.ts +10 -0
  59. package/api/resources/triggers/client/Client.js +10 -0
  60. package/api/resources/users/client/Client.d.ts +16 -0
  61. package/api/resources/users/client/Client.js +16 -0
  62. package/api/resources/voice/client/Client.d.ts +3 -2
  63. package/api/resources/voice/client/Client.js +3 -2
  64. package/api/resources/voice/types/VoiceSessionTokenRequest.d.ts +14 -3
  65. package/api/resources/voice/types/VoiceSessionTokenResponse.d.ts +11 -1
  66. package/api/resources/voice/types/VoiceWebRtcTransport.d.ts +10 -0
  67. package/api/resources/voice/types/VoiceWebRtcTransport.js +13 -0
  68. package/api/resources/voice/types/index.d.ts +1 -0
  69. package/api/resources/voice/types/index.js +1 -0
  70. package/api/resources/voiceConversations/client/Client.d.ts +5 -2
  71. package/api/resources/voiceConversations/client/Client.js +6 -3
  72. package/api/resources/voiceConversations/client/Socket.d.ts +2 -1
  73. package/api/resources/voiceConversations/client/Socket.js +10 -0
  74. package/api/resources/voiceConversations/types/AgentAudioChunk.d.ts +1 -1
  75. package/api/resources/voiceConversations/types/AudioFormat.d.ts +13 -0
  76. package/api/resources/voiceConversations/types/AudioFormat.js +13 -0
  77. package/api/resources/voiceConversations/types/ClientMark.d.ts +10 -0
  78. package/api/resources/voiceConversations/types/Config.d.ts +2 -6
  79. package/api/resources/voiceConversations/types/ConversationReady.d.ts +5 -2
  80. package/api/resources/voiceConversations/types/Error_.d.ts +8 -0
  81. package/api/resources/voiceConversations/types/Mark.d.ts +9 -0
  82. package/api/resources/voiceConversations/types/ServerEventBase.d.ts +3 -2
  83. package/api/resources/voiceConversations/types/Transcript.d.ts +11 -0
  84. package/api/resources/voiceConversations/types/TranscriptRole.d.ts +5 -0
  85. package/api/resources/voiceConversations/types/TranscriptRole.js +8 -0
  86. package/api/resources/voiceConversations/types/VadSpeechStarted.d.ts +8 -0
  87. package/api/resources/voiceConversations/types/VadSpeechStarted.js +3 -0
  88. package/api/resources/voiceConversations/types/VadSpeechStopped.d.ts +7 -0
  89. package/api/resources/voiceConversations/types/VadSpeechStopped.js +3 -0
  90. package/api/resources/voiceConversations/types/index.d.ts +6 -5
  91. package/api/resources/voiceConversations/types/index.js +6 -5
  92. package/package.json +1 -1
  93. package/reference.md +292 -21
  94. package/serialization/resources/capabilities/client/requests/CapabilityExecutionsSearchRequest.d.ts +2 -0
  95. package/serialization/resources/capabilities/client/requests/CapabilityExecutionsSearchRequest.js +2 -0
  96. package/serialization/resources/commons/types/SimulationContext.d.ts +1 -0
  97. package/serialization/resources/commons/types/SimulationContext.js +1 -0
  98. package/serialization/resources/commons/types/SystemEventName.d.ts +1 -1
  99. package/serialization/resources/commons/types/SystemEventName.js +1 -0
  100. package/serialization/resources/conversation/types/AskRequest.d.ts +2 -12
  101. package/serialization/resources/conversation/types/AskRequest.js +5 -13
  102. package/serialization/resources/conversation/types/AskRequestBase.d.ts +20 -0
  103. package/serialization/resources/conversation/types/AskRequestBase.js +52 -0
  104. package/serialization/resources/conversation/types/index.d.ts +1 -0
  105. package/serialization/resources/conversation/types/index.js +1 -0
  106. package/serialization/resources/knowledge/types/KnowledgeDocumentMetadataValue.d.ts +7 -0
  107. package/serialization/resources/{voiceConversations/types/UserTranscript.js → knowledge/types/KnowledgeDocumentMetadataValue.js} +5 -8
  108. package/serialization/resources/knowledge/types/KnowledgeDocumentRequest.d.ts +2 -1
  109. package/serialization/resources/knowledge/types/KnowledgeDocumentRequest.js +2 -1
  110. package/serialization/resources/knowledge/types/KnowledgeDocumentResponse.d.ts +2 -1
  111. package/serialization/resources/knowledge/types/KnowledgeDocumentResponse.js +2 -1
  112. package/serialization/resources/knowledge/types/index.d.ts +1 -0
  113. package/serialization/resources/knowledge/types/index.js +1 -0
  114. package/serialization/resources/voice/types/VoiceSessionTokenRequest.d.ts +2 -0
  115. package/serialization/resources/voice/types/VoiceSessionTokenRequest.js +2 -0
  116. package/serialization/resources/voice/types/VoiceSessionTokenResponse.d.ts +1 -0
  117. package/serialization/resources/voice/types/VoiceSessionTokenResponse.js +1 -0
  118. package/serialization/resources/voice/types/VoiceWebRtcTransport.d.ts +7 -0
  119. package/serialization/resources/voice/types/VoiceWebRtcTransport.js +39 -0
  120. package/serialization/resources/voice/types/index.d.ts +1 -0
  121. package/serialization/resources/voice/types/index.js +1 -0
  122. package/serialization/resources/voiceConversations/client/socket/VoiceConversationsSocketResponse.d.ts +6 -7
  123. package/serialization/resources/voiceConversations/client/socket/VoiceConversationsSocketResponse.js +8 -10
  124. package/serialization/resources/voiceConversations/types/ClientMark.d.ts +10 -0
  125. package/serialization/resources/voiceConversations/types/ClientMark.js +42 -0
  126. package/serialization/resources/voiceConversations/types/Config.d.ts +0 -2
  127. package/serialization/resources/voiceConversations/types/Config.js +0 -2
  128. package/serialization/resources/voiceConversations/types/ConversationReady.d.ts +3 -1
  129. package/serialization/resources/voiceConversations/types/ConversationReady.js +6 -2
  130. package/serialization/resources/voiceConversations/types/{ConversationEnded.d.ts → Mark.d.ts} +4 -3
  131. package/serialization/resources/voiceConversations/types/{UserStartedSpeaking.js → Mark.js} +4 -3
  132. package/serialization/resources/voiceConversations/types/ServerEventBase.d.ts +1 -1
  133. package/serialization/resources/voiceConversations/types/ServerEventBase.js +1 -1
  134. package/serialization/resources/voiceConversations/types/{AgentTranscript.d.ts → Transcript.d.ts} +5 -3
  135. package/serialization/resources/voiceConversations/types/{AgentTranscript.js → Transcript.js} +5 -3
  136. package/serialization/resources/voiceConversations/types/TranscriptRole.d.ts +7 -0
  137. package/serialization/resources/voiceConversations/types/TranscriptRole.js +39 -0
  138. package/serialization/resources/voiceConversations/types/{UserTranscript.d.ts → VadSpeechStarted.d.ts} +3 -4
  139. package/serialization/resources/voiceConversations/types/{ConversationEnded.js → VadSpeechStarted.js} +3 -3
  140. package/serialization/resources/voiceConversations/types/{UserStartedSpeaking.d.ts → VadSpeechStopped.d.ts} +3 -3
  141. package/serialization/resources/voiceConversations/types/{UserFinishedSpeaking.js → VadSpeechStopped.js} +3 -3
  142. package/serialization/resources/voiceConversations/types/index.d.ts +6 -5
  143. package/serialization/resources/voiceConversations/types/index.js +6 -5
  144. package/version.d.ts +1 -1
  145. package/version.js +1 -1
  146. package/api/resources/voiceConversations/types/AgentTranscript.d.ts +0 -9
  147. package/api/resources/voiceConversations/types/ConversationEnded.d.ts +0 -7
  148. package/api/resources/voiceConversations/types/UserFinishedSpeaking.d.ts +0 -7
  149. package/api/resources/voiceConversations/types/UserStartedSpeaking.d.ts +0 -7
  150. package/api/resources/voiceConversations/types/UserTranscript.d.ts +0 -9
  151. package/serialization/resources/voiceConversations/types/UserFinishedSpeaking.d.ts +0 -10
  152. /package/api/resources/{voiceConversations/types/AgentTranscript.js → conversation/types/AskRequestBase.js} +0 -0
  153. /package/api/resources/{voiceConversations/types/ConversationEnded.js → knowledge/types/KnowledgeDocumentMetadataValue.js} +0 -0
  154. /package/api/resources/voiceConversations/types/{UserFinishedSpeaking.js → ClientMark.js} +0 -0
  155. /package/api/resources/voiceConversations/types/{UserStartedSpeaking.js → Mark.js} +0 -0
  156. /package/api/resources/voiceConversations/types/{UserTranscript.js → Transcript.js} +0 -0
@@ -3,22 +3,33 @@ export interface VoiceSessionTokenRequest {
3
3
  /**
4
4
  * The end user identity for the voice session.
5
5
  * Must contain only alphanumeric characters, dots, hyphens, or underscores.
6
+ * For "webrtc" tokens, at most 184 characters. A longer value fails with 400.
6
7
  */
7
8
  appUserId: string;
8
9
  /**
9
10
  * The type of session token to generate.
10
- * Use "webrtc" for browser-based calls via Twilio, or "websocket" for direct WebSocket connections.
11
+ * Use "webrtc" for browser-based calls, or "websocket" for direct WebSocket connections.
12
+ * For "webrtc", `transport` selects the Maven telephony gateway (default) or Twilio.
11
13
  */
12
14
  type: MavenAGI.VoiceTokenType;
15
+ /**
16
+ * The transport for a "webrtc" call. Default: "gateway".
17
+ * - "gateway": the response `token` is a token for the Maven telephony gateway, and the response includes `connectUrl`.
18
+ * - "twilio": the response `token` is a Twilio access token.
19
+ *
20
+ * The server ignores this field for "websocket" tokens.
21
+ */
22
+ transport?: MavenAGI.VoiceWebRtcTransport;
13
23
  /**
14
24
  * Arbitrary key-value metadata to associate with this session (e.g., conversationId, topic).
15
25
  *
16
- * **Constraints**: at most 50 keys, each key up to 256 characters, each value up to 4096 characters.
26
+ * **Constraints**: at most 10 keys, each key up to 256 characters, each value up to 500 characters.
27
+ * A request that exceeds any limit fails with 400 and lists each field that exceeded it; values are never truncated.
28
+ * For WebRTC calls, each key is stored in conversation metadata as `custom_<key>`.
17
29
  * Values are stored as-is — for small data, embed the value directly (e.g., `"callerName": "John Doe"`).
18
30
  *
19
31
  * For WebRTC tokens, this data is stored server-side and referenced by a secure ID
20
32
  * encoded in the token identity, ensuring it cannot be tampered with by the client.
21
- * For WebSocket tokens, clients can also pass data directly in the Config message.
22
33
  */
23
34
  customData?: Record<string, string>;
24
35
  }
@@ -1,6 +1,10 @@
1
1
  import type * as MavenAGI from "../../../index";
2
2
  export interface VoiceSessionTokenResponse {
3
- /** Opaque JWT session token. Pass this in the Authorization header when connecting. */
3
+ /**
4
+ * Opaque session token. Pass this in the Authorization header when connecting.
5
+ * For "websocket", the token is an ES256 JWT.
6
+ * For "webrtc", the token format depends on `transport`.
7
+ */
4
8
  token: string;
5
9
  /** The identity string associated with this token (echoes appUserId). */
6
10
  identity: string;
@@ -8,4 +12,10 @@ export interface VoiceSessionTokenResponse {
8
12
  type: MavenAGI.VoiceTokenType;
9
13
  /** Time in seconds until the token expires. */
10
14
  expiresIn: number;
15
+ /**
16
+ * The URL that starts a "webrtc" call through the Maven telephony gateway.
17
+ * The client sends `token` to this URL to start the call.
18
+ * Present only when the request sets `transport` to "gateway".
19
+ */
20
+ connectUrl?: string;
11
21
  }
@@ -0,0 +1,10 @@
1
+ /** The transport that carries a "webrtc" call. */
2
+ export declare const VoiceWebRtcTransport: {
3
+ /**
4
+ * The Maven telephony gateway. The token is a gateway token. */
5
+ readonly Gateway: "gateway";
6
+ /**
7
+ * Twilio Voice. The token is a Twilio access token. */
8
+ readonly Twilio: "twilio";
9
+ };
10
+ export type VoiceWebRtcTransport = (typeof VoiceWebRtcTransport)[keyof typeof VoiceWebRtcTransport] | string;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.VoiceWebRtcTransport = void 0;
5
+ /** The transport that carries a "webrtc" call. */
6
+ exports.VoiceWebRtcTransport = {
7
+ /**
8
+ * The Maven telephony gateway. The token is a gateway token. */
9
+ Gateway: "gateway",
10
+ /**
11
+ * Twilio Voice. The token is a Twilio access token. */
12
+ Twilio: "twilio",
13
+ };
@@ -1,3 +1,4 @@
1
1
  export * from "./VoiceSessionTokenRequest";
2
2
  export * from "./VoiceSessionTokenResponse";
3
3
  export * from "./VoiceTokenType";
4
+ export * from "./VoiceWebRtcTransport";
@@ -17,3 +17,4 @@ Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./VoiceSessionTokenRequest"), exports);
18
18
  __exportStar(require("./VoiceSessionTokenResponse"), exports);
19
19
  __exportStar(require("./VoiceTokenType"), exports);
20
+ __exportStar(require("./VoiceWebRtcTransport"), exports);
@@ -5,8 +5,11 @@ import { VoiceConversationsSocket } from "./Socket";
5
5
  export declare namespace VoiceConversationsClient {
6
6
  type Options = BaseClientOptions;
7
7
  interface ConnectArgs {
8
- version?: string;
9
- Authorization: string;
8
+ orgId: string;
9
+ agentId: string;
10
+ voiceModel?: string;
11
+ token?: string;
12
+ Authorization?: string | undefined;
10
13
  /** WebSocket subprotocols to use for the connection. */
11
14
  protocols?: string | string[];
12
15
  /** Additional query parameters to send with the websocket connect request. */
@@ -56,14 +56,17 @@ class VoiceConversationsClient {
56
56
  connect(args) {
57
57
  return __awaiter(this, void 0, void 0, function* () {
58
58
  var _a, _b, _c;
59
- const { version, protocols, queryParams, headers, debug, reconnectAttempts, connectionTimeoutInSeconds, abortSignal, shouldReconnect, } = args;
59
+ const { orgId, agentId, voiceModel, token, protocols, queryParams, headers, debug, reconnectAttempts, connectionTimeoutInSeconds, abortSignal, shouldReconnect, } = args;
60
60
  const _queryParams = {
61
- version,
61
+ orgId,
62
+ agentId,
63
+ voiceModel,
64
+ token,
62
65
  };
63
66
  const _authRequest = yield this._options.authProvider.getAuthRequest();
64
67
  const _headers = (0, headers_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_1.mergeOnlyDefinedHeaders)({ Authorization: args.Authorization }), headers);
65
68
  const socket = new core.ReconnectingWebSocket({
66
- url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.MavenAGIEnvironment.Production, "/v1/voice/conversations"),
69
+ url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.MavenAGIEnvironment.Production, "/v1/realtime/conversations"),
67
70
  protocols: protocols !== null && protocols !== void 0 ? protocols : [],
68
71
  queryParameters: Object.assign(Object.assign({}, _queryParams), queryParams),
69
72
  headers: _headers,
@@ -4,7 +4,7 @@ export declare namespace VoiceConversationsSocket {
4
4
  interface Args {
5
5
  socket: core.ReconnectingWebSocket;
6
6
  }
7
- type Response = MavenAGI.ConversationReady | MavenAGI.AgentAudioChunk | MavenAGI.UserTranscript | MavenAGI.AgentTranscript | MavenAGI.ConversationEnded | MavenAGI.UserStartedSpeaking | MavenAGI.UserFinishedSpeaking | MavenAGI.Error_;
7
+ type Response = MavenAGI.ConversationReady | MavenAGI.AgentAudioChunk | MavenAGI.Mark | MavenAGI.Transcript | MavenAGI.VadSpeechStarted | MavenAGI.VadSpeechStopped | MavenAGI.Error_;
8
8
  type EventHandlers = {
9
9
  open?: () => void;
10
10
  message?: (message: Response) => void;
@@ -46,6 +46,7 @@ export declare class VoiceConversationsSocket {
46
46
  off<T extends keyof VoiceConversationsSocket.EventHandlers>(event: T, callback: VoiceConversationsSocket.EventHandlers[T]): void;
47
47
  sendConfig(message: MavenAGI.Config): void;
48
48
  sendUserAudioChunk(message: MavenAGI.UserAudioChunk): void;
49
+ sendClientMark(message: MavenAGI.ClientMark): void;
49
50
  /** Connect to the websocket and register event handlers. Safe to call multiple times: each handler is only registered if it is not already attached. */
50
51
  connect(): VoiceConversationsSocket;
51
52
  /** Close the websocket and unregister event handlers. */
@@ -47,6 +47,7 @@ exports.VoiceConversationsSocket = void 0;
47
47
  const core = __importStar(require("../../../../core"));
48
48
  const json_1 = require("../../../../core/json");
49
49
  const serializers = __importStar(require("../../../../serialization/index"));
50
+ const ClientMark_1 = require("../../../../serialization/resources/voiceConversations/types/ClientMark");
50
51
  const Config_1 = require("../../../../serialization/resources/voiceConversations/types/Config");
51
52
  const UserAudioChunk_1 = require("../../../../serialization/resources/voiceConversations/types/UserAudioChunk");
52
53
  class VoiceConversationsSocket {
@@ -136,6 +137,15 @@ class VoiceConversationsSocket {
136
137
  });
137
138
  this.socket.send(JSON.stringify(jsonPayload));
138
139
  }
140
+ sendClientMark(message) {
141
+ this.assertSocketIsOpen();
142
+ const jsonPayload = ClientMark_1.ClientMark.jsonOrThrow(message, {
143
+ unrecognizedObjectKeys: "passthrough",
144
+ allowUnrecognizedUnionMembers: true,
145
+ allowUnrecognizedEnumValues: true,
146
+ });
147
+ this.socket.send(JSON.stringify(jsonPayload));
148
+ }
139
149
  /** Connect to the websocket and register event handlers. Safe to call multiple times: each handler is only registered if it is not already attached. */
140
150
  connect() {
141
151
  this.socket.reconnect();
@@ -4,6 +4,6 @@ import type * as MavenAGI from "../../../index";
4
4
  */
5
5
  export interface AgentAudioChunk extends MavenAGI.ServerEventBase {
6
6
  type: "agent_audio_chunk";
7
- /** Base64-encoded AI audio data */
7
+ /** Base64-encoded agent audio, in the `outputFormat` from the `Config` message. */
8
8
  data: string;
9
9
  }
@@ -1,7 +1,20 @@
1
+ /**
2
+ * Audio format for both directions. Audio is mono and base64-encoded in each message.
3
+ * Only `PCM_8000` and `MULAW_8000` are supported. `PCM_16000` and `PCM_44100` are rejected
4
+ * with an `invalid_audio_format` error.
5
+ */
1
6
  export declare const AudioFormat: {
7
+ /**
8
+ * Not supported. PCM 16-bit little-endian, 44.1 kHz. */
2
9
  readonly Pcm44100: "PCM_44100";
10
+ /**
11
+ * Not supported. PCM 16-bit little-endian, 16 kHz. */
3
12
  readonly Pcm16000: "PCM_16000";
13
+ /**
14
+ * PCM 16-bit little-endian, 8 kHz. */
4
15
  readonly Pcm8000: "PCM_8000";
16
+ /**
17
+ * G.711 μ-law, 8 kHz. */
5
18
  readonly Mulaw8000: "MULAW_8000";
6
19
  };
7
20
  export type AudioFormat = (typeof AudioFormat)[keyof typeof AudioFormat] | string;
@@ -2,9 +2,22 @@
2
2
  // This file was auto-generated by Fern from our API Definition.
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.AudioFormat = void 0;
5
+ /**
6
+ * Audio format for both directions. Audio is mono and base64-encoded in each message.
7
+ * Only `PCM_8000` and `MULAW_8000` are supported. `PCM_16000` and `PCM_44100` are rejected
8
+ * with an `invalid_audio_format` error.
9
+ */
5
10
  exports.AudioFormat = {
11
+ /**
12
+ * Not supported. PCM 16-bit little-endian, 44.1 kHz. */
6
13
  Pcm44100: "PCM_44100",
14
+ /**
15
+ * Not supported. PCM 16-bit little-endian, 16 kHz. */
7
16
  Pcm16000: "PCM_16000",
17
+ /**
18
+ * PCM 16-bit little-endian, 8 kHz. */
8
19
  Pcm8000: "PCM_8000",
20
+ /**
21
+ * G.711 μ-law, 8 kHz. */
9
22
  Mulaw8000: "MULAW_8000",
10
23
  };
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Echo of a server `mark` message. Send it, with the same `name`, once all agent audio received
3
+ * before that mark has played. Agent audio the client drops (for example on `vad_speech_started`)
4
+ * counts as played. A missing echo delays the agent until a server-side timeout.
5
+ */
6
+ export interface ClientMark {
7
+ type: "mark";
8
+ /** The `name` from the server `mark` message. */
9
+ name: string;
10
+ }
@@ -4,12 +4,8 @@ import type * as MavenAGI from "../../../index";
4
4
  */
5
5
  export interface Config {
6
6
  type: "config";
7
- /** The input audio format from the client. */
7
+ /** The audio format the client sends. Must be `PCM_8000` or `MULAW_8000`. */
8
8
  inputFormat: MavenAGI.AudioFormat;
9
- /** The output audio format to send to the client. */
9
+ /** The audio format the server sends. Must equal `inputFormat`, or the server returns an `invalid_configuration` error. */
10
10
  outputFormat: MavenAGI.AudioFormat;
11
- /** The conversation ID which was created prior to starting this conversation. */
12
- conversationId: string;
13
- /** The app ID this conversation ID is associated with. */
14
- appId: string;
15
11
  }
@@ -1,6 +1,9 @@
1
+ import type * as MavenAGI from "../../../index";
1
2
  /**
2
- * Conversation created successfully.
3
+ * Conversation created successfully. The client may start sending audio.
3
4
  */
4
- export interface ConversationReady {
5
+ export interface ConversationReady extends MavenAGI.ServerEventBase {
5
6
  type: "conversation_ready";
7
+ /** The conversation ID the server created for this connection. */
8
+ sessionId: string;
6
9
  }
@@ -5,5 +5,13 @@ import type * as MavenAGI from "../../../index";
5
5
  export interface Error_ extends MavenAGI.ServerEventBase {
6
6
  type: "error";
7
7
  message: string;
8
+ /**
9
+ * One of:
10
+ * - `invalid_message`: the server could not parse a client message, or its `type` is unknown.
11
+ * - `invalid_configuration`: `outputFormat` differs from `inputFormat`.
12
+ * - `invalid_audio_format`: the format is not `PCM_8000` or `MULAW_8000`.
13
+ * - `initialization_error`: the connection failed before the conversation started, including authentication and rate-limit failures.
14
+ * - `internal_error`: the voice model reported an error during the conversation.
15
+ */
8
16
  code: string;
9
17
  }
@@ -0,0 +1,9 @@
1
+ import type * as MavenAGI from "../../../index";
2
+ /**
3
+ * Playback mark between agent audio chunks. The client must echo it as a `ClientMark` with the
4
+ * same `name` once it has played all agent audio received before it.
5
+ */
6
+ export interface Mark extends MavenAGI.ServerEventBase {
7
+ type: "mark";
8
+ name: string;
9
+ }
@@ -1,6 +1,7 @@
1
1
  /**
2
- * Base event type for all server events.
2
+ * Base event type for server events.
3
3
  */
4
4
  export interface ServerEventBase {
5
- eventId: string;
5
+ /** When the server sent the event. */
6
+ timestamp: Date;
6
7
  }
@@ -0,0 +1,11 @@
1
+ import type * as MavenAGI from "../../../index";
2
+ /**
3
+ * Transcript of a completed user or agent utterance.
4
+ */
5
+ export interface Transcript extends MavenAGI.ServerEventBase {
6
+ type: "transcript";
7
+ /** Who spoke. */
8
+ role: MavenAGI.TranscriptRole;
9
+ /** Transcribed speech. */
10
+ text: string;
11
+ }
@@ -0,0 +1,5 @@
1
+ export declare const TranscriptRole: {
2
+ readonly User: "user";
3
+ readonly Agent: "agent";
4
+ };
5
+ export type TranscriptRole = (typeof TranscriptRole)[keyof typeof TranscriptRole] | string;
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.TranscriptRole = void 0;
5
+ exports.TranscriptRole = {
6
+ User: "user",
7
+ Agent: "agent",
8
+ };
@@ -0,0 +1,8 @@
1
+ import type * as MavenAGI from "../../../index";
2
+ /**
3
+ * Voice activity detection heard the user start speaking. The client should stop playing and
4
+ * drop any queued agent audio.
5
+ */
6
+ export interface VadSpeechStarted extends MavenAGI.ServerEventBase {
7
+ type: "vad_speech_started";
8
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,7 @@
1
+ import type * as MavenAGI from "../../../index";
2
+ /**
3
+ * Voice activity detection heard the user stop speaking.
4
+ */
5
+ export interface VadSpeechStopped extends MavenAGI.ServerEventBase {
6
+ type: "vad_speech_stopped";
7
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,12 +1,13 @@
1
1
  export * from "./AgentAudioChunk";
2
- export * from "./AgentTranscript";
3
2
  export * from "./AudioFormat";
3
+ export * from "./ClientMark";
4
4
  export * from "./Config";
5
- export * from "./ConversationEnded";
6
5
  export * from "./ConversationReady";
7
6
  export * from "./Error_";
7
+ export * from "./Mark";
8
8
  export * from "./ServerEventBase";
9
+ export * from "./Transcript";
10
+ export * from "./TranscriptRole";
9
11
  export * from "./UserAudioChunk";
10
- export * from "./UserFinishedSpeaking";
11
- export * from "./UserStartedSpeaking";
12
- export * from "./UserTranscript";
12
+ export * from "./VadSpeechStarted";
13
+ export * from "./VadSpeechStopped";
@@ -15,14 +15,15 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./AgentAudioChunk"), exports);
18
- __exportStar(require("./AgentTranscript"), exports);
19
18
  __exportStar(require("./AudioFormat"), exports);
19
+ __exportStar(require("./ClientMark"), exports);
20
20
  __exportStar(require("./Config"), exports);
21
- __exportStar(require("./ConversationEnded"), exports);
22
21
  __exportStar(require("./ConversationReady"), exports);
23
22
  __exportStar(require("./Error_"), exports);
23
+ __exportStar(require("./Mark"), exports);
24
24
  __exportStar(require("./ServerEventBase"), exports);
25
+ __exportStar(require("./Transcript"), exports);
26
+ __exportStar(require("./TranscriptRole"), exports);
25
27
  __exportStar(require("./UserAudioChunk"), exports);
26
- __exportStar(require("./UserFinishedSpeaking"), exports);
27
- __exportStar(require("./UserStartedSpeaking"), exports);
28
- __exportStar(require("./UserTranscript"), exports);
28
+ __exportStar(require("./VadSpeechStarted"), exports);
29
+ __exportStar(require("./VadSpeechStopped"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mavenagi",
3
- "version": "1.2.67",
3
+ "version": "1.2.69",
4
4
  "private": false,
5
5
  "repository": {
6
6
  "type": "git",