phonic 0.31.12 → 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 (116) hide show
  1. package/dist/cjs/BaseClient.js +2 -2
  2. package/dist/cjs/Client.d.ts +6 -0
  3. package/dist/cjs/Client.js +20 -10
  4. package/dist/cjs/api/errors/UnprocessableEntityError.d.ts +6 -0
  5. package/dist/cjs/api/errors/UnprocessableEntityError.js +54 -0
  6. package/dist/cjs/api/errors/index.d.ts +1 -0
  7. package/dist/cjs/api/errors/index.js +1 -0
  8. package/dist/cjs/api/resources/conversationItems/client/Client.d.ts +39 -0
  9. package/dist/cjs/api/resources/conversationItems/client/Client.js +139 -0
  10. package/dist/cjs/api/resources/conversationItems/client/index.d.ts +1 -0
  11. package/dist/cjs/api/resources/conversationItems/client/index.js +17 -0
  12. package/dist/cjs/api/resources/conversationItems/client/requests/ReplayConversationItemRequest.d.ts +12 -0
  13. package/dist/cjs/api/resources/conversationItems/client/requests/ReplayConversationItemRequest.js +3 -0
  14. package/dist/cjs/api/resources/conversationItems/client/requests/index.d.ts +1 -0
  15. package/dist/cjs/api/resources/conversationItems/client/requests/index.js +2 -0
  16. package/dist/cjs/api/resources/conversationItems/exports.d.ts +2 -0
  17. package/dist/cjs/api/resources/conversationItems/exports.js +21 -0
  18. package/dist/cjs/api/resources/conversationItems/index.d.ts +1 -0
  19. package/dist/cjs/api/resources/conversationItems/index.js +17 -0
  20. package/dist/cjs/api/resources/conversations/client/Client.d.ts +1 -0
  21. package/dist/cjs/api/resources/conversations/client/Client.js +3 -0
  22. package/dist/cjs/api/resources/conversations/types/ConversationsListResponse.d.ts +1 -9
  23. package/dist/cjs/api/resources/index.d.ts +4 -0
  24. package/dist/cjs/api/resources/index.js +5 -1
  25. package/dist/cjs/api/resources/projects/client/requests/UpdateProjectRequest.d.ts +2 -0
  26. package/dist/cjs/api/resources/workspace/client/Client.d.ts +26 -0
  27. package/dist/cjs/api/resources/workspace/client/Client.js +110 -0
  28. package/dist/cjs/api/resources/workspace/client/index.d.ts +1 -0
  29. package/dist/cjs/api/resources/workspace/client/index.js +2 -0
  30. package/dist/cjs/api/resources/workspace/exports.d.ts +2 -0
  31. package/dist/cjs/api/resources/workspace/exports.js +21 -0
  32. package/dist/cjs/api/resources/workspace/index.d.ts +2 -0
  33. package/dist/cjs/api/resources/workspace/index.js +18 -0
  34. package/dist/cjs/api/resources/workspace/types/WorkspaceGetResponse.d.ts +6 -0
  35. package/dist/cjs/api/resources/workspace/types/WorkspaceGetResponse.js +3 -0
  36. package/dist/cjs/api/resources/workspace/types/index.d.ts +1 -0
  37. package/dist/cjs/api/resources/workspace/types/index.js +17 -0
  38. package/dist/cjs/api/types/BadRequestErrorBody.d.ts +1 -1
  39. package/dist/cjs/api/types/Conversation.d.ts +8 -0
  40. package/dist/cjs/api/types/ConversationItem.d.ts +2 -0
  41. package/dist/cjs/api/types/ConversationsListResponseConversation.d.ts +4 -0
  42. package/dist/cjs/api/types/ConversationsListResponseConversation.js +3 -0
  43. package/dist/cjs/api/types/ConversationsListResponseConversations.d.ts +5 -0
  44. package/dist/cjs/api/types/ConversationsListResponseConversations.js +3 -0
  45. package/dist/cjs/api/types/ConversationsListResponseConversationsPagination.d.ts +6 -0
  46. package/dist/cjs/api/types/ConversationsListResponseConversationsPagination.js +3 -0
  47. package/dist/cjs/api/types/Project.d.ts +4 -0
  48. package/dist/cjs/api/types/ReplayConversationItemResponse.d.ts +16 -0
  49. package/dist/cjs/api/types/ReplayConversationItemResponse.js +3 -0
  50. package/dist/cjs/api/types/ReplayToolCall.d.ts +29 -0
  51. package/dist/cjs/api/types/ReplayToolCall.js +12 -0
  52. package/dist/cjs/api/types/SipCallError.d.ts +24 -0
  53. package/dist/cjs/api/types/SipCallError.js +16 -0
  54. package/dist/cjs/api/types/index.d.ts +6 -0
  55. package/dist/cjs/api/types/index.js +6 -0
  56. package/dist/cjs/version.d.ts +1 -1
  57. package/dist/cjs/version.js +1 -1
  58. package/dist/esm/BaseClient.mjs +2 -2
  59. package/dist/esm/Client.d.mts +6 -0
  60. package/dist/esm/Client.mjs +10 -0
  61. package/dist/esm/api/errors/UnprocessableEntityError.d.mts +6 -0
  62. package/dist/esm/api/errors/UnprocessableEntityError.mjs +17 -0
  63. package/dist/esm/api/errors/index.d.mts +1 -0
  64. package/dist/esm/api/errors/index.mjs +1 -0
  65. package/dist/esm/api/resources/conversationItems/client/Client.d.mts +39 -0
  66. package/dist/esm/api/resources/conversationItems/client/Client.mjs +102 -0
  67. package/dist/esm/api/resources/conversationItems/client/index.d.mts +1 -0
  68. package/dist/esm/api/resources/conversationItems/client/index.mjs +1 -0
  69. package/dist/esm/api/resources/conversationItems/client/requests/ReplayConversationItemRequest.d.mts +12 -0
  70. package/dist/esm/api/resources/conversationItems/client/requests/ReplayConversationItemRequest.mjs +2 -0
  71. package/dist/esm/api/resources/conversationItems/client/requests/index.d.mts +1 -0
  72. package/dist/esm/api/resources/conversationItems/client/requests/index.mjs +1 -0
  73. package/dist/esm/api/resources/conversationItems/exports.d.mts +2 -0
  74. package/dist/esm/api/resources/conversationItems/exports.mjs +3 -0
  75. package/dist/esm/api/resources/conversationItems/index.d.mts +1 -0
  76. package/dist/esm/api/resources/conversationItems/index.mjs +1 -0
  77. package/dist/esm/api/resources/conversations/client/Client.d.mts +1 -0
  78. package/dist/esm/api/resources/conversations/client/Client.mjs +3 -0
  79. package/dist/esm/api/resources/conversations/types/ConversationsListResponse.d.mts +1 -9
  80. package/dist/esm/api/resources/index.d.mts +4 -0
  81. package/dist/esm/api/resources/index.mjs +4 -0
  82. package/dist/esm/api/resources/projects/client/requests/UpdateProjectRequest.d.mts +2 -0
  83. package/dist/esm/api/resources/workspace/client/Client.d.mts +26 -0
  84. package/dist/esm/api/resources/workspace/client/Client.mjs +73 -0
  85. package/dist/esm/api/resources/workspace/client/index.d.mts +1 -0
  86. package/dist/esm/api/resources/workspace/client/index.mjs +1 -0
  87. package/dist/esm/api/resources/workspace/exports.d.mts +2 -0
  88. package/dist/esm/api/resources/workspace/exports.mjs +3 -0
  89. package/dist/esm/api/resources/workspace/index.d.mts +2 -0
  90. package/dist/esm/api/resources/workspace/index.mjs +2 -0
  91. package/dist/esm/api/resources/workspace/types/WorkspaceGetResponse.d.mts +6 -0
  92. package/dist/esm/api/resources/workspace/types/WorkspaceGetResponse.mjs +2 -0
  93. package/dist/esm/api/resources/workspace/types/index.d.mts +1 -0
  94. package/dist/esm/api/resources/workspace/types/index.mjs +1 -0
  95. package/dist/esm/api/types/BadRequestErrorBody.d.mts +1 -1
  96. package/dist/esm/api/types/Conversation.d.mts +8 -0
  97. package/dist/esm/api/types/ConversationItem.d.mts +2 -0
  98. package/dist/esm/api/types/ConversationsListResponseConversation.d.mts +4 -0
  99. package/dist/esm/api/types/ConversationsListResponseConversation.mjs +2 -0
  100. package/dist/esm/api/types/ConversationsListResponseConversations.d.mts +5 -0
  101. package/dist/esm/api/types/ConversationsListResponseConversations.mjs +2 -0
  102. package/dist/esm/api/types/ConversationsListResponseConversationsPagination.d.mts +6 -0
  103. package/dist/esm/api/types/ConversationsListResponseConversationsPagination.mjs +2 -0
  104. package/dist/esm/api/types/Project.d.mts +4 -0
  105. package/dist/esm/api/types/ReplayConversationItemResponse.d.mts +16 -0
  106. package/dist/esm/api/types/ReplayConversationItemResponse.mjs +2 -0
  107. package/dist/esm/api/types/ReplayToolCall.d.mts +29 -0
  108. package/dist/esm/api/types/ReplayToolCall.mjs +9 -0
  109. package/dist/esm/api/types/SipCallError.d.mts +24 -0
  110. package/dist/esm/api/types/SipCallError.mjs +13 -0
  111. package/dist/esm/api/types/index.d.mts +6 -0
  112. package/dist/esm/api/types/index.mjs +6 -0
  113. package/dist/esm/version.d.mts +1 -1
  114. package/dist/esm/version.mjs +1 -1
  115. package/package.json +23 -1
  116. package/reference.md +134 -0
@@ -0,0 +1,110 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
+ if (k2 === undefined) k2 = k;
5
+ var desc = Object.getOwnPropertyDescriptor(m, k);
6
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
+ desc = { enumerable: true, get: function() { return m[k]; } };
8
+ }
9
+ Object.defineProperty(o, k2, desc);
10
+ }) : (function(o, m, k, k2) {
11
+ if (k2 === undefined) k2 = k;
12
+ o[k2] = m[k];
13
+ }));
14
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
15
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
16
+ }) : function(o, v) {
17
+ o["default"] = v;
18
+ });
19
+ var __importStar = (this && this.__importStar) || (function () {
20
+ var ownKeys = function(o) {
21
+ ownKeys = Object.getOwnPropertyNames || function (o) {
22
+ var ar = [];
23
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
24
+ return ar;
25
+ };
26
+ return ownKeys(o);
27
+ };
28
+ return function (mod) {
29
+ if (mod && mod.__esModule) return mod;
30
+ var result = {};
31
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
32
+ __setModuleDefault(result, mod);
33
+ return result;
34
+ };
35
+ })();
36
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
37
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
38
+ return new (P || (P = Promise))(function (resolve, reject) {
39
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
40
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
41
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
42
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
43
+ });
44
+ };
45
+ Object.defineProperty(exports, "__esModule", { value: true });
46
+ exports.WorkspaceClient = void 0;
47
+ const BaseClient_js_1 = require("../../../../BaseClient.js");
48
+ const headers_js_1 = require("../../../../core/headers.js");
49
+ const core = __importStar(require("../../../../core/index.js"));
50
+ const environments = __importStar(require("../../../../environments.js"));
51
+ const handleNonStatusCodeError_js_1 = require("../../../../errors/handleNonStatusCodeError.js");
52
+ const errors = __importStar(require("../../../../errors/index.js"));
53
+ const Phonic = __importStar(require("../../../index.js"));
54
+ class WorkspaceClient {
55
+ constructor(options = {}) {
56
+ this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
57
+ }
58
+ /**
59
+ * Returns information about the workspace.
60
+ *
61
+ * @param {WorkspaceClient.RequestOptions} requestOptions - Request-specific configuration.
62
+ *
63
+ * @throws {@link Phonic.UnauthorizedError}
64
+ * @throws {@link Phonic.InternalServerError}
65
+ *
66
+ * @example
67
+ * await client.workspace.get()
68
+ */
69
+ get(requestOptions) {
70
+ return core.HttpResponsePromise.fromPromise(this.__get(requestOptions));
71
+ }
72
+ __get(requestOptions) {
73
+ return __awaiter(this, void 0, void 0, function* () {
74
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
75
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
76
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
77
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
78
+ 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)
79
+ .base, "workspace"),
80
+ method: "GET",
81
+ headers: _headers,
82
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
83
+ 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,
84
+ 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,
85
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
86
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
87
+ logging: this._options.logging,
88
+ });
89
+ if (_response.ok) {
90
+ return { data: _response.body, rawResponse: _response.rawResponse };
91
+ }
92
+ if (_response.error.reason === "status-code") {
93
+ switch (_response.error.statusCode) {
94
+ case 401:
95
+ throw new Phonic.UnauthorizedError(_response.error.body, _response.rawResponse);
96
+ case 500:
97
+ throw new Phonic.InternalServerError(_response.error.body, _response.rawResponse);
98
+ default:
99
+ throw new errors.PhonicError({
100
+ statusCode: _response.error.statusCode,
101
+ body: _response.error.body,
102
+ rawResponse: _response.rawResponse,
103
+ });
104
+ }
105
+ }
106
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/workspace");
107
+ });
108
+ }
109
+ }
110
+ exports.WorkspaceClient = WorkspaceClient;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ export { WorkspaceClient } from "./client/Client.js";
2
+ export * from "./client/index.js";
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
+ if (k2 === undefined) k2 = k;
5
+ var desc = Object.getOwnPropertyDescriptor(m, k);
6
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
+ desc = { enumerable: true, get: function() { return m[k]; } };
8
+ }
9
+ Object.defineProperty(o, k2, desc);
10
+ }) : (function(o, m, k, k2) {
11
+ if (k2 === undefined) k2 = k;
12
+ o[k2] = m[k];
13
+ }));
14
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
16
+ };
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.WorkspaceClient = void 0;
19
+ var Client_js_1 = require("./client/Client.js");
20
+ Object.defineProperty(exports, "WorkspaceClient", { enumerable: true, get: function () { return Client_js_1.WorkspaceClient; } });
21
+ __exportStar(require("./client/index.js"), exports);
@@ -0,0 +1,2 @@
1
+ export * from "./client/index.js";
2
+ export * from "./types/index.js";
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./client/index.js"), exports);
18
+ __exportStar(require("./types/index.js"), exports);
@@ -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,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 @@
1
+ export * from "./WorkspaceGetResponse.js";
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./WorkspaceGetResponse.js"), exports);
@@ -1,2 +1,2 @@
1
1
  import type * as Phonic from "../index.js";
2
- export type BadRequestErrorBody = Phonic.ValidationError | Phonic.BasicError;
2
+ export type BadRequestErrorBody = Phonic.ValidationError | Phonic.BasicError | Phonic.SipCallError;
@@ -66,6 +66,14 @@ export interface Conversation {
66
66
  no_input_poke_text: string | null;
67
67
  /** Seconds of silence before the conversation is ended. */
68
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;
69
77
  /** Results from conversation evaluations and extractions. */
70
78
  task_results: Record<string, unknown>;
71
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.js";
2
+ export interface ConversationsListResponseConversation {
3
+ conversation: Phonic.Conversation;
4
+ }
@@ -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,5 @@
1
+ import type * as Phonic from "../index.js";
2
+ export interface ConversationsListResponseConversations {
3
+ conversations: Phonic.Conversation[];
4
+ pagination: Phonic.ConversationsListResponseConversationsPagination;
5
+ }
@@ -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,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,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -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.js";
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,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,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,12 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.ReplayToolCall = void 0;
5
+ var ReplayToolCall;
6
+ (function (ReplayToolCall) {
7
+ /** HTTP method for webhook tool calls. */
8
+ ReplayToolCall.EndpointMethod = {
9
+ Get: "GET",
10
+ Post: "POST",
11
+ };
12
+ })(ReplayToolCall || (exports.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,16 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.SipCallError = void 0;
5
+ var SipCallError;
6
+ (function (SipCallError) {
7
+ let Error_;
8
+ (function (Error_) {
9
+ /** Machine-readable error code. */
10
+ Error_.Code = {
11
+ SipCallFailed: "sip_call_failed",
12
+ SipAuthFailed: "sip_auth_failed",
13
+ InvalidPhoneNumber: "invalid_phone_number",
14
+ };
15
+ })(Error_ = SipCallError.Error_ || (SipCallError.Error_ = {}));
16
+ })(SipCallError || (exports.SipCallError = SipCallError = {}));
@@ -19,6 +19,9 @@ export * from "./ConversationEvaluation.js";
19
19
  export * from "./ConversationEvaluationResult.js";
20
20
  export * from "./ConversationExtraction.js";
21
21
  export * from "./ConversationItem.js";
22
+ export * from "./ConversationsListResponseConversation.js";
23
+ export * from "./ConversationsListResponseConversations.js";
24
+ export * from "./ConversationsListResponseConversationsPagination.js";
22
25
  export * from "./CreateAgentRequest.js";
23
26
  export * from "./DtmfPayload.js";
24
27
  export * from "./Error_.js";
@@ -35,9 +38,12 @@ export * from "./OutboundCallInitiatedResponse.js";
35
38
  export * from "./OutboundDryRunResponse.js";
36
39
  export * from "./Project.js";
37
40
  export * from "./ReadyToStartConversationPayload.js";
41
+ export * from "./ReplayConversationItemResponse.js";
42
+ export * from "./ReplayToolCall.js";
38
43
  export * from "./ResetPayload.js";
39
44
  export * from "./SayPayload.js";
40
45
  export * from "./SetExternalIdPayload.js";
46
+ export * from "./SipCallError.js";
41
47
  export * from "./SipOutboundCallInitiatedResponse.js";
42
48
  export * from "./SipOutboundDryRunResponse.js";
43
49
  export * from "./Task.js";
@@ -35,6 +35,9 @@ __exportStar(require("./ConversationEvaluation.js"), exports);
35
35
  __exportStar(require("./ConversationEvaluationResult.js"), exports);
36
36
  __exportStar(require("./ConversationExtraction.js"), exports);
37
37
  __exportStar(require("./ConversationItem.js"), exports);
38
+ __exportStar(require("./ConversationsListResponseConversation.js"), exports);
39
+ __exportStar(require("./ConversationsListResponseConversations.js"), exports);
40
+ __exportStar(require("./ConversationsListResponseConversationsPagination.js"), exports);
38
41
  __exportStar(require("./CreateAgentRequest.js"), exports);
39
42
  __exportStar(require("./DtmfPayload.js"), exports);
40
43
  __exportStar(require("./Error_.js"), exports);
@@ -51,9 +54,12 @@ __exportStar(require("./OutboundCallInitiatedResponse.js"), exports);
51
54
  __exportStar(require("./OutboundDryRunResponse.js"), exports);
52
55
  __exportStar(require("./Project.js"), exports);
53
56
  __exportStar(require("./ReadyToStartConversationPayload.js"), exports);
57
+ __exportStar(require("./ReplayConversationItemResponse.js"), exports);
58
+ __exportStar(require("./ReplayToolCall.js"), exports);
54
59
  __exportStar(require("./ResetPayload.js"), exports);
55
60
  __exportStar(require("./SayPayload.js"), exports);
56
61
  __exportStar(require("./SetExternalIdPayload.js"), exports);
62
+ __exportStar(require("./SipCallError.js"), exports);
57
63
  __exportStar(require("./SipOutboundCallInitiatedResponse.js"), exports);
58
64
  __exportStar(require("./SipOutboundDryRunResponse.js"), exports);
59
65
  __exportStar(require("./Task.js"), exports);
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.31.12";
1
+ export declare const SDK_VERSION = "0.31.13";
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SDK_VERSION = void 0;
4
- exports.SDK_VERSION = "0.31.12";
4
+ exports.SDK_VERSION = "0.31.13";
@@ -6,8 +6,8 @@ export function normalizeClientOptions(options) {
6
6
  const headers = mergeHeaders({
7
7
  "X-Fern-Language": "JavaScript",
8
8
  "X-Fern-SDK-Name": "phonic",
9
- "X-Fern-SDK-Version": "0.31.12",
10
- "User-Agent": "phonic/0.31.12",
9
+ "X-Fern-SDK-Version": "0.31.13",
10
+ "User-Agent": "phonic/0.31.13",
11
11
  "X-Fern-Runtime": core.RUNTIME.type,
12
12
  "X-Fern-Runtime-Version": core.RUNTIME.version,
13
13
  }, options === null || options === void 0 ? void 0 : options.headers);
@@ -1,10 +1,12 @@
1
1
  import { AgentsClient } from "./api/resources/agents/client/Client.mjs";
2
2
  import { AuthClient } from "./api/resources/auth/client/Client.mjs";
3
+ import { ConversationItemsClient } from "./api/resources/conversationItems/client/Client.mjs";
3
4
  import { ConversationsClient } from "./api/resources/conversations/client/Client.mjs";
4
5
  import { ExtractionSchemasClient } from "./api/resources/extractionSchemas/client/Client.mjs";
5
6
  import { ProjectsClient } from "./api/resources/projects/client/Client.mjs";
6
7
  import { ToolsClient } from "./api/resources/tools/client/Client.mjs";
7
8
  import { VoicesClient } from "./api/resources/voices/client/Client.mjs";
9
+ import { WorkspaceClient } from "./api/resources/workspace/client/Client.mjs";
8
10
  import type { BaseClientOptions, BaseRequestOptions } from "./BaseClient.mjs";
9
11
  import { type NormalizedClientOptionsWithAuth } from "./BaseClient.mjs";
10
12
  import * as core from "./core/index.mjs";
@@ -28,16 +30,20 @@ export declare class PhonicClient {
28
30
  protected _extractionSchemas: ExtractionSchemasClient | undefined;
29
31
  protected _voices: VoicesClient | undefined;
30
32
  protected _conversations: ConversationsClient | undefined;
33
+ protected _conversationItems: ConversationItemsClient | undefined;
31
34
  protected _auth: AuthClient | undefined;
32
35
  protected _projects: ProjectsClient | undefined;
36
+ protected _workspace: WorkspaceClient | undefined;
33
37
  constructor(options?: PhonicClient.Options);
34
38
  get agents(): AgentsClient;
35
39
  get tools(): ToolsClient;
36
40
  get extractionSchemas(): ExtractionSchemasClient;
37
41
  get voices(): VoicesClient;
38
42
  get conversations(): ConversationsClient;
43
+ get conversationItems(): ConversationItemsClient;
39
44
  get auth(): AuthClient;
40
45
  get projects(): ProjectsClient;
46
+ get workspace(): WorkspaceClient;
41
47
  /**
42
48
  * Make a passthrough request using the SDK's configured auth, retry, logging, etc.
43
49
  * This is useful for making requests to endpoints not yet supported in the SDK.
@@ -10,11 +10,13 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
10
10
  };
11
11
  import { AgentsClient } from "./api/resources/agents/client/Client.mjs";
12
12
  import { AuthClient } from "./api/resources/auth/client/Client.mjs";
13
+ import { ConversationItemsClient } from "./api/resources/conversationItems/client/Client.mjs";
13
14
  import { ConversationsClient } from "./api/resources/conversations/client/Client.mjs";
14
15
  import { ExtractionSchemasClient } from "./api/resources/extractionSchemas/client/Client.mjs";
15
16
  import { ProjectsClient } from "./api/resources/projects/client/Client.mjs";
16
17
  import { ToolsClient } from "./api/resources/tools/client/Client.mjs";
17
18
  import { VoicesClient } from "./api/resources/voices/client/Client.mjs";
19
+ import { WorkspaceClient } from "./api/resources/workspace/client/Client.mjs";
18
20
  import { normalizeClientOptionsWithAuth } from "./BaseClient.mjs";
19
21
  import * as core from "./core/index.mjs";
20
22
  import * as environments from "./environments.mjs";
@@ -42,6 +44,10 @@ export class PhonicClient {
42
44
  var _a;
43
45
  return ((_a = this._conversations) !== null && _a !== void 0 ? _a : (this._conversations = new ConversationsClient(this._options)));
44
46
  }
47
+ get conversationItems() {
48
+ var _a;
49
+ return ((_a = this._conversationItems) !== null && _a !== void 0 ? _a : (this._conversationItems = new ConversationItemsClient(this._options)));
50
+ }
45
51
  get auth() {
46
52
  var _a;
47
53
  return ((_a = this._auth) !== null && _a !== void 0 ? _a : (this._auth = new AuthClient(this._options)));
@@ -50,6 +56,10 @@ export class PhonicClient {
50
56
  var _a;
51
57
  return ((_a = this._projects) !== null && _a !== void 0 ? _a : (this._projects = new ProjectsClient(this._options)));
52
58
  }
59
+ get workspace() {
60
+ var _a;
61
+ return ((_a = this._workspace) !== null && _a !== void 0 ? _a : (this._workspace = new WorkspaceClient(this._options)));
62
+ }
53
63
  /**
54
64
  * Make a passthrough request using the SDK's configured auth, retry, logging, etc.
55
65
  * This is useful for making requests to endpoints not yet supported in the SDK.
@@ -0,0 +1,6 @@
1
+ import type * as core from "../../core/index.mjs";
2
+ import * as errors from "../../errors/index.mjs";
3
+ import type * as Phonic from "../index.mjs";
4
+ export declare class UnprocessableEntityError extends errors.PhonicError {
5
+ constructor(body: Phonic.BasicError, rawResponse?: core.RawResponse);
6
+ }
@@ -0,0 +1,17 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ import * as errors from "../../errors/index.mjs";
3
+ export class UnprocessableEntityError extends errors.PhonicError {
4
+ constructor(body, rawResponse) {
5
+ super({
6
+ message: "UnprocessableEntityError",
7
+ statusCode: 422,
8
+ body: body,
9
+ rawResponse: rawResponse,
10
+ });
11
+ Object.setPrototypeOf(this, new.target.prototype);
12
+ if (Error.captureStackTrace) {
13
+ Error.captureStackTrace(this, this.constructor);
14
+ }
15
+ this.name = this.constructor.name;
16
+ }
17
+ }
@@ -5,3 +5,4 @@ export * from "./GatewayTimeoutError.mjs";
5
5
  export * from "./InternalServerError.mjs";
6
6
  export * from "./NotFoundError.mjs";
7
7
  export * from "./UnauthorizedError.mjs";
8
+ export * from "./UnprocessableEntityError.mjs";
@@ -5,3 +5,4 @@ export * from "./GatewayTimeoutError.mjs";
5
5
  export * from "./InternalServerError.mjs";
6
6
  export * from "./NotFoundError.mjs";
7
7
  export * from "./UnauthorizedError.mjs";
8
+ export * from "./UnprocessableEntityError.mjs";
@@ -0,0 +1,39 @@
1
+ import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.mjs";
2
+ import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.mjs";
3
+ import * as core from "../../../../core/index.mjs";
4
+ import * as Phonic from "../../../index.mjs";
5
+ export declare namespace ConversationItemsClient {
6
+ type Options = BaseClientOptions;
7
+ interface RequestOptions extends BaseRequestOptions {
8
+ }
9
+ }
10
+ export declare class ConversationItemsClient {
11
+ protected readonly _options: NormalizedClientOptionsWithAuth<ConversationItemsClient.Options>;
12
+ constructor(options?: ConversationItemsClient.Options);
13
+ /**
14
+ * Returns the alternative response(s) the assistant would have
15
+ * produced for this conversation turn given changes to the agent system prompt.
16
+ *
17
+ * Only assistant items from ended conversations can be replayed. The
18
+ * conversation must have an associated agent.
19
+ *
20
+ * @param {string} id - The ID of the conversation item to replay.
21
+ * @param {Phonic.ReplayConversationItemRequest} request
22
+ * @param {ConversationItemsClient.RequestOptions} requestOptions - Request-specific configuration.
23
+ *
24
+ * @throws {@link Phonic.BadRequestError}
25
+ * @throws {@link Phonic.UnauthorizedError}
26
+ * @throws {@link Phonic.ForbiddenError}
27
+ * @throws {@link Phonic.NotFoundError}
28
+ * @throws {@link Phonic.ConflictError}
29
+ * @throws {@link Phonic.UnprocessableEntityError}
30
+ * @throws {@link Phonic.InternalServerError}
31
+ *
32
+ * @example
33
+ * await client.conversationItems.replay("id", {
34
+ * system_prompt: "system_prompt"
35
+ * })
36
+ */
37
+ replay(id: string, request: Phonic.ReplayConversationItemRequest, requestOptions?: ConversationItemsClient.RequestOptions): core.HttpResponsePromise<Phonic.ReplayConversationItemResponse>;
38
+ private __replay;
39
+ }