phonic 0.31.11 → 0.31.13

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 (153) hide show
  1. package/README.md +1 -0
  2. package/dist/cjs/BaseClient.js +2 -2
  3. package/dist/cjs/Client.d.ts +6 -0
  4. package/dist/cjs/Client.js +20 -10
  5. package/dist/cjs/api/errors/UnprocessableEntityError.d.ts +6 -0
  6. package/dist/cjs/api/errors/UnprocessableEntityError.js +54 -0
  7. package/dist/cjs/api/errors/index.d.ts +1 -0
  8. package/dist/cjs/api/errors/index.js +1 -0
  9. package/dist/cjs/api/resources/agents/client/Client.d.ts +3 -0
  10. package/dist/cjs/api/resources/agents/client/Client.js +3 -0
  11. package/dist/cjs/api/resources/agents/client/requests/AgentsCreateRequest.d.ts +3 -0
  12. package/dist/cjs/api/resources/agents/client/requests/UpdateAgentRequest.d.ts +3 -0
  13. package/dist/cjs/api/resources/agents/client/requests/UpsertAgentRequest.d.ts +1 -0
  14. package/dist/cjs/api/resources/conversationItems/client/Client.d.ts +39 -0
  15. package/dist/cjs/api/resources/conversationItems/client/Client.js +139 -0
  16. package/dist/cjs/api/resources/conversationItems/client/index.d.ts +1 -0
  17. package/dist/cjs/api/resources/conversationItems/client/index.js +17 -0
  18. package/dist/cjs/api/resources/conversationItems/client/requests/ReplayConversationItemRequest.d.ts +12 -0
  19. package/dist/cjs/api/resources/conversationItems/client/requests/ReplayConversationItemRequest.js +3 -0
  20. package/dist/cjs/api/resources/conversationItems/client/requests/index.d.ts +1 -0
  21. package/dist/cjs/api/resources/conversationItems/client/requests/index.js +2 -0
  22. package/dist/cjs/api/resources/conversationItems/exports.d.ts +2 -0
  23. package/dist/cjs/api/resources/conversationItems/exports.js +21 -0
  24. package/dist/cjs/api/resources/conversationItems/index.d.ts +1 -0
  25. package/dist/cjs/api/resources/conversationItems/index.js +17 -0
  26. package/dist/cjs/api/resources/conversations/client/Client.d.ts +1 -0
  27. package/dist/cjs/api/resources/conversations/client/Client.js +3 -0
  28. package/dist/cjs/api/resources/conversations/client/Socket.d.ts +3 -1
  29. package/dist/cjs/api/resources/conversations/client/Socket.js +8 -0
  30. package/dist/cjs/api/resources/conversations/client/requests/OutboundCallRequest.d.ts +1 -0
  31. package/dist/cjs/api/resources/conversations/types/ConversationsListResponse.d.ts +1 -9
  32. package/dist/cjs/api/resources/index.d.ts +4 -0
  33. package/dist/cjs/api/resources/index.js +5 -1
  34. package/dist/cjs/api/resources/projects/client/requests/UpdateProjectRequest.d.ts +2 -0
  35. package/dist/cjs/api/resources/workspace/client/Client.d.ts +26 -0
  36. package/dist/cjs/api/resources/workspace/client/Client.js +110 -0
  37. package/dist/cjs/api/resources/workspace/client/index.d.ts +1 -0
  38. package/dist/cjs/api/resources/workspace/client/index.js +2 -0
  39. package/dist/cjs/api/resources/workspace/exports.d.ts +2 -0
  40. package/dist/cjs/api/resources/workspace/exports.js +21 -0
  41. package/dist/cjs/api/resources/workspace/index.d.ts +2 -0
  42. package/dist/cjs/api/resources/workspace/index.js +18 -0
  43. package/dist/cjs/api/resources/workspace/types/WorkspaceGetResponse.d.ts +6 -0
  44. package/dist/cjs/api/resources/workspace/types/WorkspaceGetResponse.js +3 -0
  45. package/dist/cjs/api/resources/workspace/types/index.d.ts +1 -0
  46. package/dist/cjs/api/resources/workspace/types/index.js +17 -0
  47. package/dist/cjs/api/types/Agent.d.ts +2 -0
  48. package/dist/cjs/api/types/BadRequestErrorBody.d.ts +1 -1
  49. package/dist/cjs/api/types/ConfigOptions.d.ts +2 -0
  50. package/dist/cjs/api/types/Conversation.d.ts +10 -0
  51. package/dist/cjs/api/types/ConversationItem.d.ts +2 -0
  52. package/dist/cjs/api/types/ConversationsListResponseConversation.d.ts +4 -0
  53. package/dist/cjs/api/types/ConversationsListResponseConversation.js +3 -0
  54. package/dist/cjs/api/types/ConversationsListResponseConversations.d.ts +5 -0
  55. package/dist/cjs/api/types/ConversationsListResponseConversations.js +3 -0
  56. package/dist/cjs/api/types/ConversationsListResponseConversationsPagination.d.ts +6 -0
  57. package/dist/cjs/api/types/ConversationsListResponseConversationsPagination.js +3 -0
  58. package/dist/cjs/api/types/CreateAgentRequest.d.ts +2 -0
  59. package/dist/cjs/api/types/MutePayload.d.ts +3 -0
  60. package/dist/cjs/api/types/MutePayload.js +3 -0
  61. package/dist/cjs/api/types/OutboundCallConfig.d.ts +2 -0
  62. package/dist/cjs/api/types/Project.d.ts +4 -0
  63. package/dist/cjs/api/types/ReplayConversationItemResponse.d.ts +16 -0
  64. package/dist/cjs/api/types/ReplayConversationItemResponse.js +3 -0
  65. package/dist/cjs/api/types/ReplayToolCall.d.ts +29 -0
  66. package/dist/cjs/api/types/ReplayToolCall.js +12 -0
  67. package/dist/cjs/api/types/SipCallError.d.ts +24 -0
  68. package/dist/cjs/api/types/SipCallError.js +16 -0
  69. package/dist/cjs/api/types/UnmutePayload.d.ts +3 -0
  70. package/dist/cjs/api/types/UnmutePayload.js +3 -0
  71. package/dist/cjs/api/types/index.d.ts +8 -0
  72. package/dist/cjs/api/types/index.js +8 -0
  73. package/dist/cjs/custom/ReconnectableConversationsSocket.d.ts +2 -0
  74. package/dist/cjs/custom/ReconnectableConversationsSocket.js +6 -0
  75. package/dist/cjs/version.d.ts +1 -1
  76. package/dist/cjs/version.js +1 -1
  77. package/dist/esm/BaseClient.mjs +2 -2
  78. package/dist/esm/Client.d.mts +6 -0
  79. package/dist/esm/Client.mjs +10 -0
  80. package/dist/esm/api/errors/UnprocessableEntityError.d.mts +6 -0
  81. package/dist/esm/api/errors/UnprocessableEntityError.mjs +17 -0
  82. package/dist/esm/api/errors/index.d.mts +1 -0
  83. package/dist/esm/api/errors/index.mjs +1 -0
  84. package/dist/esm/api/resources/agents/client/Client.d.mts +3 -0
  85. package/dist/esm/api/resources/agents/client/Client.mjs +3 -0
  86. package/dist/esm/api/resources/agents/client/requests/AgentsCreateRequest.d.mts +3 -0
  87. package/dist/esm/api/resources/agents/client/requests/UpdateAgentRequest.d.mts +3 -0
  88. package/dist/esm/api/resources/agents/client/requests/UpsertAgentRequest.d.mts +1 -0
  89. package/dist/esm/api/resources/conversationItems/client/Client.d.mts +39 -0
  90. package/dist/esm/api/resources/conversationItems/client/Client.mjs +102 -0
  91. package/dist/esm/api/resources/conversationItems/client/index.d.mts +1 -0
  92. package/dist/esm/api/resources/conversationItems/client/index.mjs +1 -0
  93. package/dist/esm/api/resources/conversationItems/client/requests/ReplayConversationItemRequest.d.mts +12 -0
  94. package/dist/esm/api/resources/conversationItems/client/requests/ReplayConversationItemRequest.mjs +2 -0
  95. package/dist/esm/api/resources/conversationItems/client/requests/index.d.mts +1 -0
  96. package/dist/esm/api/resources/conversationItems/client/requests/index.mjs +1 -0
  97. package/dist/esm/api/resources/conversationItems/exports.d.mts +2 -0
  98. package/dist/esm/api/resources/conversationItems/exports.mjs +3 -0
  99. package/dist/esm/api/resources/conversationItems/index.d.mts +1 -0
  100. package/dist/esm/api/resources/conversationItems/index.mjs +1 -0
  101. package/dist/esm/api/resources/conversations/client/Client.d.mts +1 -0
  102. package/dist/esm/api/resources/conversations/client/Client.mjs +3 -0
  103. package/dist/esm/api/resources/conversations/client/Socket.d.mts +3 -1
  104. package/dist/esm/api/resources/conversations/client/Socket.mjs +8 -0
  105. package/dist/esm/api/resources/conversations/client/requests/OutboundCallRequest.d.mts +1 -0
  106. package/dist/esm/api/resources/conversations/types/ConversationsListResponse.d.mts +1 -9
  107. package/dist/esm/api/resources/index.d.mts +4 -0
  108. package/dist/esm/api/resources/index.mjs +4 -0
  109. package/dist/esm/api/resources/projects/client/requests/UpdateProjectRequest.d.mts +2 -0
  110. package/dist/esm/api/resources/workspace/client/Client.d.mts +26 -0
  111. package/dist/esm/api/resources/workspace/client/Client.mjs +73 -0
  112. package/dist/esm/api/resources/workspace/client/index.d.mts +1 -0
  113. package/dist/esm/api/resources/workspace/client/index.mjs +1 -0
  114. package/dist/esm/api/resources/workspace/exports.d.mts +2 -0
  115. package/dist/esm/api/resources/workspace/exports.mjs +3 -0
  116. package/dist/esm/api/resources/workspace/index.d.mts +2 -0
  117. package/dist/esm/api/resources/workspace/index.mjs +2 -0
  118. package/dist/esm/api/resources/workspace/types/WorkspaceGetResponse.d.mts +6 -0
  119. package/dist/esm/api/resources/workspace/types/WorkspaceGetResponse.mjs +2 -0
  120. package/dist/esm/api/resources/workspace/types/index.d.mts +1 -0
  121. package/dist/esm/api/resources/workspace/types/index.mjs +1 -0
  122. package/dist/esm/api/types/Agent.d.mts +2 -0
  123. package/dist/esm/api/types/BadRequestErrorBody.d.mts +1 -1
  124. package/dist/esm/api/types/ConfigOptions.d.mts +2 -0
  125. package/dist/esm/api/types/Conversation.d.mts +10 -0
  126. package/dist/esm/api/types/ConversationItem.d.mts +2 -0
  127. package/dist/esm/api/types/ConversationsListResponseConversation.d.mts +4 -0
  128. package/dist/esm/api/types/ConversationsListResponseConversation.mjs +2 -0
  129. package/dist/esm/api/types/ConversationsListResponseConversations.d.mts +5 -0
  130. package/dist/esm/api/types/ConversationsListResponseConversations.mjs +2 -0
  131. package/dist/esm/api/types/ConversationsListResponseConversationsPagination.d.mts +6 -0
  132. package/dist/esm/api/types/ConversationsListResponseConversationsPagination.mjs +2 -0
  133. package/dist/esm/api/types/CreateAgentRequest.d.mts +2 -0
  134. package/dist/esm/api/types/MutePayload.d.mts +3 -0
  135. package/dist/esm/api/types/MutePayload.mjs +2 -0
  136. package/dist/esm/api/types/OutboundCallConfig.d.mts +2 -0
  137. package/dist/esm/api/types/Project.d.mts +4 -0
  138. package/dist/esm/api/types/ReplayConversationItemResponse.d.mts +16 -0
  139. package/dist/esm/api/types/ReplayConversationItemResponse.mjs +2 -0
  140. package/dist/esm/api/types/ReplayToolCall.d.mts +29 -0
  141. package/dist/esm/api/types/ReplayToolCall.mjs +9 -0
  142. package/dist/esm/api/types/SipCallError.d.mts +24 -0
  143. package/dist/esm/api/types/SipCallError.mjs +13 -0
  144. package/dist/esm/api/types/UnmutePayload.d.mts +3 -0
  145. package/dist/esm/api/types/UnmutePayload.mjs +2 -0
  146. package/dist/esm/api/types/index.d.mts +8 -0
  147. package/dist/esm/api/types/index.mjs +8 -0
  148. package/dist/esm/custom/ReconnectableConversationsSocket.d.mts +2 -0
  149. package/dist/esm/custom/ReconnectableConversationsSocket.mjs +6 -0
  150. package/dist/esm/version.d.mts +1 -1
  151. package/dist/esm/version.mjs +1 -1
  152. package/package.json +23 -1
  153. package/reference.md +138 -0
@@ -0,0 +1,73 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ import { normalizeClientOptionsWithAuth } from "../../../../BaseClient.mjs";
12
+ import { mergeHeaders } from "../../../../core/headers.mjs";
13
+ import * as core from "../../../../core/index.mjs";
14
+ import * as environments from "../../../../environments.mjs";
15
+ import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.mjs";
16
+ import * as errors from "../../../../errors/index.mjs";
17
+ import * as Phonic from "../../../index.mjs";
18
+ export class WorkspaceClient {
19
+ constructor(options = {}) {
20
+ this._options = normalizeClientOptionsWithAuth(options);
21
+ }
22
+ /**
23
+ * Returns information about the workspace.
24
+ *
25
+ * @param {WorkspaceClient.RequestOptions} requestOptions - Request-specific configuration.
26
+ *
27
+ * @throws {@link Phonic.UnauthorizedError}
28
+ * @throws {@link Phonic.InternalServerError}
29
+ *
30
+ * @example
31
+ * await client.workspace.get()
32
+ */
33
+ get(requestOptions) {
34
+ return core.HttpResponsePromise.fromPromise(this.__get(requestOptions));
35
+ }
36
+ __get(requestOptions) {
37
+ return __awaiter(this, void 0, void 0, function* () {
38
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
39
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
40
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
41
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
42
+ url: core.url.join((_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : ((_d = (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.PhonicEnvironment.Default)
43
+ .base, "workspace"),
44
+ method: "GET",
45
+ headers: _headers,
46
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
47
+ timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
48
+ maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
49
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
50
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
51
+ logging: this._options.logging,
52
+ });
53
+ if (_response.ok) {
54
+ return { data: _response.body, rawResponse: _response.rawResponse };
55
+ }
56
+ if (_response.error.reason === "status-code") {
57
+ switch (_response.error.statusCode) {
58
+ case 401:
59
+ throw new Phonic.UnauthorizedError(_response.error.body, _response.rawResponse);
60
+ case 500:
61
+ throw new Phonic.InternalServerError(_response.error.body, _response.rawResponse);
62
+ default:
63
+ throw new errors.PhonicError({
64
+ statusCode: _response.error.statusCode,
65
+ body: _response.error.body,
66
+ rawResponse: _response.rawResponse,
67
+ });
68
+ }
69
+ }
70
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/workspace");
71
+ });
72
+ }
73
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ export { WorkspaceClient } from "./client/Client.mjs";
2
+ export * from "./client/index.mjs";
@@ -0,0 +1,3 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export { WorkspaceClient } from "./client/Client.mjs";
3
+ export * from "./client/index.mjs";
@@ -0,0 +1,2 @@
1
+ export * from "./client/index.mjs";
2
+ export * from "./types/index.mjs";
@@ -0,0 +1,2 @@
1
+ export * from "./client/index.mjs";
2
+ export * from "./types/index.mjs";
@@ -0,0 +1,6 @@
1
+ export interface WorkspaceGetResponse {
2
+ /** Number of conversations currently in progress for this workspace. */
3
+ active_conversations: number;
4
+ /** Maximum number of concurrent conversations allowed for this workspace. */
5
+ max_active_conversations: number;
6
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1 @@
1
+ export * from "./WorkspaceGetResponse.mjs";
@@ -0,0 +1 @@
1
+ export * from "./WorkspaceGetResponse.mjs";
@@ -50,6 +50,8 @@ export interface Agent {
50
50
  languages?: Phonic.LanguageCode[] | undefined;
51
51
  /** If `"auto"`, each user audio is automatically identified for the language to respond in. If `"request"`, user must request to change language (recommended). */
52
52
  multilingual_mode: Agent.MultilingualMode;
53
+ /** Push to talk mode. User must send mute/unmute messages to turn on/off listening to audio. Defaults to false. */
54
+ push_to_talk: boolean;
53
55
  /** These words, or short phrases, will be more accurately recognized by the agent. */
54
56
  boosted_keywords: string[];
55
57
  /** Minimum number of words required to interrupt the assistant. */
@@ -1,2 +1,2 @@
1
1
  import type * as Phonic from "../index.mjs";
2
- export type BadRequestErrorBody = Phonic.ValidationError | Phonic.BasicError;
2
+ export type BadRequestErrorBody = Phonic.ValidationError | Phonic.BasicError | Phonic.SipCallError;
@@ -50,6 +50,8 @@ export interface ConfigOptions {
50
50
  additional_languages?: string[] | undefined;
51
51
  /** If `"auto"`, each user audio is automatically identified for the language to respond in. If `"request"`, user must request to change language (recommended). */
52
52
  multilingual_mode?: ConfigOptions.MultilingualMode | undefined;
53
+ /** Push to talk mode. User must send mute/unmute messages to turn on/off listening to audio. Defaults to false. */
54
+ push_to_talk?: boolean | undefined;
53
55
  /** Keywords to boost in speech recognition */
54
56
  boosted_keywords?: string[] | undefined;
55
57
  /** Names of tools available to the assistant. */
@@ -54,6 +54,8 @@ export interface Conversation {
54
54
  additional_languages: string[] | null;
55
55
  /** If `"auto"`, each user audio is automatically identified for the language to respond in. If `"request"`, user must request to change language (recommended). */
56
56
  multilingual_mode: Conversation.MultilingualMode;
57
+ /** Push to talk mode. User must send mute/unmute messages to turn on/off listening to audio. Defaults to false. */
58
+ push_to_talk: boolean;
57
59
  /** Array of ISO 639-1 language codes recognized by the model. This field is deprecated. Use `default_language` and `additional_languages` instead. */
58
60
  languages?: (string[] | null) | undefined;
59
61
  /** Whether the no-input poke text was generated by AI. */
@@ -64,6 +66,14 @@ export interface Conversation {
64
66
  no_input_poke_text: string | null;
65
67
  /** Seconds of silence before the conversation is ended. */
66
68
  no_input_end_conversation_sec: number | null;
69
+ /** Voice activity detection prebuffer duration in milliseconds. `null` when not applicable or unknown (e.g. push-to-talk, or legacy stored conversations). */
70
+ vad_prebuffer_duration_ms?: (number | null) | undefined;
71
+ /** Minimum speech duration for voice activity detection in milliseconds. `null` when not applicable or unknown. */
72
+ vad_min_speech_duration_ms?: (number | null) | undefined;
73
+ /** Minimum silence duration for voice activity detection in milliseconds. `null` when not applicable or unknown. */
74
+ vad_min_silence_duration_ms?: (number | null) | undefined;
75
+ /** Voice activity detection threshold. `null` when not applicable or unknown. */
76
+ vad_threshold?: (number | null) | undefined;
67
77
  /** Results from conversation evaluations and extractions. */
68
78
  task_results: Record<string, unknown>;
69
79
  /** Array of conversation items (turns). */
@@ -1,4 +1,6 @@
1
1
  export interface ConversationItem {
2
+ /** The conversation item ID. */
3
+ id: string;
2
4
  /** Index of the item in the conversation. */
3
5
  item_idx: number;
4
6
  /** Who spoke in this turn. */
@@ -0,0 +1,4 @@
1
+ import type * as Phonic from "../index.mjs";
2
+ export interface ConversationsListResponseConversation {
3
+ conversation: Phonic.Conversation;
4
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1,5 @@
1
+ import type * as Phonic from "../index.mjs";
2
+ export interface ConversationsListResponseConversations {
3
+ conversations: Phonic.Conversation[];
4
+ pagination: Phonic.ConversationsListResponseConversationsPagination;
5
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1,6 @@
1
+ export interface ConversationsListResponseConversationsPagination {
2
+ /** Cursor to fetch the previous page of conversations (newer). Use this value in the `before` query parameter. `null` if there is no previous page. */
3
+ prev_cursor: string | null;
4
+ /** Cursor to fetch the next page of conversations (older). Use this value in the `after` query parameter. `null` if there is no next page. */
5
+ next_cursor: string | null;
6
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -48,6 +48,8 @@ export interface CreateAgentRequest {
48
48
  languages?: Phonic.LanguageCode[] | undefined;
49
49
  /** If `"auto"`, each user audio is automatically identified for the language to respond in. If `"request"`, user must request to change language (recommended). */
50
50
  multilingual_mode?: CreateAgentRequest.MultilingualMode | undefined;
51
+ /** Push to talk mode. User must send mute/unmute messages to turn on/off listening to audio. Defaults to false. */
52
+ push_to_talk?: boolean | undefined;
51
53
  /** These words, or short phrases, will be more accurately recognized by the agent. */
52
54
  boosted_keywords?: string[] | undefined;
53
55
  /** Minimum number of words required to interrupt the assistant. */
@@ -0,0 +1,3 @@
1
+ export interface MutePayload {
2
+ type: "mute";
3
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -31,6 +31,8 @@ export interface OutboundCallConfig {
31
31
  languages?: Phonic.LanguageCode[] | undefined;
32
32
  /** If `"auto"`, each user audio is automatically identified for the language to respond in. If `"request"`, user must request to change language (recommended). */
33
33
  multilingual_mode?: OutboundCallConfig.MultilingualMode | undefined;
34
+ /** Push to talk mode. User must send mute/unmute messages to turn on/off listening to audio. Defaults to false. */
35
+ push_to_talk?: boolean | undefined;
34
36
  /** These words, or short phrases, will be more accurately recognized by the agent. */
35
37
  boosted_keywords?: string[] | undefined;
36
38
  /** Minimum number of words required to interrupt the assistant. */
@@ -5,6 +5,10 @@ export interface Project {
5
5
  name: string;
6
6
  /** The project's default agent. */
7
7
  default_agent: Project.DefaultAgent | null;
8
+ /** Number of conversations currently in progress for this project. */
9
+ active_conversations: number;
10
+ /** Maximum number of concurrent conversations allowed for this project. When `null`, the workspace `max_active_conversations` limit is used. */
11
+ max_active_conversations: number | null;
8
12
  }
9
13
  export declare namespace Project {
10
14
  /**
@@ -0,0 +1,16 @@
1
+ import type * as Phonic from "../index.mjs";
2
+ export interface ReplayConversationItemResponse {
3
+ /** Alternative responses generated for the conversation item. */
4
+ responses: ReplayConversationItemResponse.Responses.Item[];
5
+ }
6
+ export declare namespace ReplayConversationItemResponse {
7
+ type Responses = Responses.Item[];
8
+ namespace Responses {
9
+ interface Item {
10
+ /** The text the LLM produced for this replay response. */
11
+ text: string;
12
+ /** Tool calls the LLM would invoke for this replay response - note that the tools will not actually be called during replay. */
13
+ tool_calls: Phonic.ReplayToolCall[];
14
+ }
15
+ }
16
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1,29 @@
1
+ export interface ReplayToolCall {
2
+ tool: ReplayToolCall.Tool;
3
+ /** HTTP method for webhook tool calls. */
4
+ endpoint_method?: ReplayToolCall.EndpointMethod | undefined;
5
+ /** URL for webhook tool calls. */
6
+ endpoint_url?: string | undefined;
7
+ /** Headers for webhook tool calls. */
8
+ endpoint_headers?: (Record<string, string | null> | null) | undefined;
9
+ /** Query parameters the LLM produced for webhook tool calls. */
10
+ query_params?: (Record<string, string | null> | null) | undefined;
11
+ /** Context returned from custom-context tool calls. */
12
+ context?: string | undefined;
13
+ /** Request body the LLM produced for the tool call. */
14
+ request_body: Record<string, unknown> | null;
15
+ }
16
+ export declare namespace ReplayToolCall {
17
+ interface Tool {
18
+ /** The tool ID. */
19
+ id: string;
20
+ /** The tool name. */
21
+ name: string;
22
+ }
23
+ /** HTTP method for webhook tool calls. */
24
+ const EndpointMethod: {
25
+ readonly Get: "GET";
26
+ readonly Post: "POST";
27
+ };
28
+ type EndpointMethod = (typeof EndpointMethod)[keyof typeof EndpointMethod];
29
+ }
@@ -0,0 +1,9 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export var ReplayToolCall;
3
+ (function (ReplayToolCall) {
4
+ /** HTTP method for webhook tool calls. */
5
+ ReplayToolCall.EndpointMethod = {
6
+ Get: "GET",
7
+ Post: "POST",
8
+ };
9
+ })(ReplayToolCall || (ReplayToolCall = {}));
@@ -0,0 +1,24 @@
1
+ export interface SipCallError {
2
+ error: SipCallError.Error_;
3
+ }
4
+ export declare namespace SipCallError {
5
+ interface Error_ {
6
+ /** Human-readable error message. */
7
+ message: string;
8
+ /** Machine-readable error code. */
9
+ code: Error_.Code;
10
+ /** The SIP response status code from the carrier (e.g. 403, 486, 603). */
11
+ sip_status_code: number;
12
+ /** The SIP response reason phrase from the carrier (e.g. "Network Blocked", "Trunk CPS limit exceeded"). */
13
+ sip_status: string;
14
+ }
15
+ namespace Error_ {
16
+ /** Machine-readable error code. */
17
+ const Code: {
18
+ readonly SipCallFailed: "sip_call_failed";
19
+ readonly SipAuthFailed: "sip_auth_failed";
20
+ readonly InvalidPhoneNumber: "invalid_phone_number";
21
+ };
22
+ type Code = (typeof Code)[keyof typeof Code];
23
+ }
24
+ }
@@ -0,0 +1,13 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export var SipCallError;
3
+ (function (SipCallError) {
4
+ let Error_;
5
+ (function (Error_) {
6
+ /** Machine-readable error code. */
7
+ Error_.Code = {
8
+ SipCallFailed: "sip_call_failed",
9
+ SipAuthFailed: "sip_auth_failed",
10
+ InvalidPhoneNumber: "invalid_phone_number",
11
+ };
12
+ })(Error_ = SipCallError.Error_ || (SipCallError.Error_ = {}));
13
+ })(SipCallError || (SipCallError = {}));
@@ -0,0 +1,3 @@
1
+ export interface UnmutePayload {
2
+ type: "unmute";
3
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -19,6 +19,9 @@ export * from "./ConversationEvaluation.mjs";
19
19
  export * from "./ConversationEvaluationResult.mjs";
20
20
  export * from "./ConversationExtraction.mjs";
21
21
  export * from "./ConversationItem.mjs";
22
+ export * from "./ConversationsListResponseConversation.mjs";
23
+ export * from "./ConversationsListResponseConversations.mjs";
24
+ export * from "./ConversationsListResponseConversationsPagination.mjs";
22
25
  export * from "./CreateAgentRequest.mjs";
23
26
  export * from "./DtmfPayload.mjs";
24
27
  export * from "./Error_.mjs";
@@ -29,14 +32,18 @@ export * from "./GenerateReplyPayload.mjs";
29
32
  export * from "./InputCancelledPayload.mjs";
30
33
  export * from "./InputTextPayload.mjs";
31
34
  export * from "./LanguageCode.mjs";
35
+ export * from "./MutePayload.mjs";
32
36
  export * from "./OutboundCallConfig.mjs";
33
37
  export * from "./OutboundCallInitiatedResponse.mjs";
34
38
  export * from "./OutboundDryRunResponse.mjs";
35
39
  export * from "./Project.mjs";
36
40
  export * from "./ReadyToStartConversationPayload.mjs";
41
+ export * from "./ReplayConversationItemResponse.mjs";
42
+ export * from "./ReplayToolCall.mjs";
37
43
  export * from "./ResetPayload.mjs";
38
44
  export * from "./SayPayload.mjs";
39
45
  export * from "./SetExternalIdPayload.mjs";
46
+ export * from "./SipCallError.mjs";
40
47
  export * from "./SipOutboundCallInitiatedResponse.mjs";
41
48
  export * from "./SipOutboundDryRunResponse.mjs";
42
49
  export * from "./Task.mjs";
@@ -46,6 +53,7 @@ export * from "./ToolCallOutputPayload.mjs";
46
53
  export * from "./ToolCallOutputProcessedPayload.mjs";
47
54
  export * from "./ToolCallPayload.mjs";
48
55
  export * from "./ToolParameter.mjs";
56
+ export * from "./UnmutePayload.mjs";
49
57
  export * from "./UpdateSystemPromptPayload.mjs";
50
58
  export * from "./UserFinishedSpeakingPayload.mjs";
51
59
  export * from "./UserStartedSpeakingPayload.mjs";
@@ -19,6 +19,9 @@ export * from "./ConversationEvaluation.mjs";
19
19
  export * from "./ConversationEvaluationResult.mjs";
20
20
  export * from "./ConversationExtraction.mjs";
21
21
  export * from "./ConversationItem.mjs";
22
+ export * from "./ConversationsListResponseConversation.mjs";
23
+ export * from "./ConversationsListResponseConversations.mjs";
24
+ export * from "./ConversationsListResponseConversationsPagination.mjs";
22
25
  export * from "./CreateAgentRequest.mjs";
23
26
  export * from "./DtmfPayload.mjs";
24
27
  export * from "./Error_.mjs";
@@ -29,14 +32,18 @@ export * from "./GenerateReplyPayload.mjs";
29
32
  export * from "./InputCancelledPayload.mjs";
30
33
  export * from "./InputTextPayload.mjs";
31
34
  export * from "./LanguageCode.mjs";
35
+ export * from "./MutePayload.mjs";
32
36
  export * from "./OutboundCallConfig.mjs";
33
37
  export * from "./OutboundCallInitiatedResponse.mjs";
34
38
  export * from "./OutboundDryRunResponse.mjs";
35
39
  export * from "./Project.mjs";
36
40
  export * from "./ReadyToStartConversationPayload.mjs";
41
+ export * from "./ReplayConversationItemResponse.mjs";
42
+ export * from "./ReplayToolCall.mjs";
37
43
  export * from "./ResetPayload.mjs";
38
44
  export * from "./SayPayload.mjs";
39
45
  export * from "./SetExternalIdPayload.mjs";
46
+ export * from "./SipCallError.mjs";
40
47
  export * from "./SipOutboundCallInitiatedResponse.mjs";
41
48
  export * from "./SipOutboundDryRunResponse.mjs";
42
49
  export * from "./Task.mjs";
@@ -46,6 +53,7 @@ export * from "./ToolCallOutputPayload.mjs";
46
53
  export * from "./ToolCallOutputProcessedPayload.mjs";
47
54
  export * from "./ToolCallPayload.mjs";
48
55
  export * from "./ToolParameter.mjs";
56
+ export * from "./UnmutePayload.mjs";
49
57
  export * from "./UpdateSystemPromptPayload.mjs";
50
58
  export * from "./UserFinishedSpeakingPayload.mjs";
51
59
  export * from "./UserStartedSpeakingPayload.mjs";
@@ -57,6 +57,8 @@ export declare class ReconnectableConversationsSocket {
57
57
  sendGenerateReply(message: Phonic.GenerateReplyPayload): void;
58
58
  sendSay(message: Phonic.SayPayload): void;
59
59
  sendReset(message: Phonic.ResetPayload): void;
60
+ sendMute(message: Phonic.MutePayload): void;
61
+ sendUnmute(message: Phonic.UnmutePayload): void;
60
62
  /**
61
63
  * Not supported — reconnection after 1006 is handled automatically.
62
64
  * To start a new conversation, create a new socket via client.conversations.connect().
@@ -98,6 +98,12 @@ export class ReconnectableConversationsSocket {
98
98
  sendReset(message) {
99
99
  this._safeSend((inner) => inner.sendReset(message));
100
100
  }
101
+ sendMute(message) {
102
+ this._safeSend((inner) => inner.sendMute(message));
103
+ }
104
+ sendUnmute(message) {
105
+ this._safeSend((inner) => inner.sendUnmute(message));
106
+ }
101
107
  /**
102
108
  * Not supported — reconnection after 1006 is handled automatically.
103
109
  * To start a new conversation, create a new socket via client.conversations.connect().
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.31.11";
1
+ export declare const SDK_VERSION = "0.31.13";
@@ -1 +1 @@
1
- export const SDK_VERSION = "0.31.11";
1
+ export const SDK_VERSION = "0.31.13";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "phonic",
3
- "version": "0.31.11",
3
+ "version": "0.31.13",
4
4
  "private": false,
5
5
  "repository": {
6
6
  "type": "git",
@@ -67,6 +67,28 @@
67
67
  },
68
68
  "default": "./dist/cjs/api/resources/voices/exports.js"
69
69
  },
70
+ "./workspace": {
71
+ "import": {
72
+ "types": "./dist/esm/api/resources/workspace/exports.d.mts",
73
+ "default": "./dist/esm/api/resources/workspace/exports.mjs"
74
+ },
75
+ "require": {
76
+ "types": "./dist/cjs/api/resources/workspace/exports.d.ts",
77
+ "default": "./dist/cjs/api/resources/workspace/exports.js"
78
+ },
79
+ "default": "./dist/cjs/api/resources/workspace/exports.js"
80
+ },
81
+ "./conversationItems": {
82
+ "import": {
83
+ "types": "./dist/esm/api/resources/conversationItems/exports.d.mts",
84
+ "default": "./dist/esm/api/resources/conversationItems/exports.mjs"
85
+ },
86
+ "require": {
87
+ "types": "./dist/cjs/api/resources/conversationItems/exports.d.ts",
88
+ "default": "./dist/cjs/api/resources/conversationItems/exports.js"
89
+ },
90
+ "default": "./dist/cjs/api/resources/conversationItems/exports.js"
91
+ },
70
92
  "./conversations": {
71
93
  "import": {
72
94
  "types": "./dist/esm/api/resources/conversations/exports.d.mts",