agentphone 1.0.5 → 1.0.6

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 (64) hide show
  1. package/dist/cjs/BaseClient.js +2 -2
  2. package/dist/cjs/api/resources/agents/client/requests/CreateAgentRequest.d.ts +18 -0
  3. package/dist/cjs/api/resources/agents/client/requests/CreateAgentRequest.js +12 -0
  4. package/dist/cjs/api/resources/agents/client/requests/UpdateAgentRequest.d.ts +18 -0
  5. package/dist/cjs/api/resources/agents/client/requests/UpdateAgentRequest.js +12 -0
  6. package/dist/cjs/api/resources/calls/client/Client.d.ts +26 -0
  7. package/dist/cjs/api/resources/calls/client/Client.js +61 -0
  8. package/dist/cjs/api/resources/calls/client/requests/CreateOutboundCallRequest.d.ts +2 -0
  9. package/dist/cjs/api/resources/calls/client/requests/CreateWebCallRequest.d.ts +2 -0
  10. package/dist/cjs/api/resources/calls/client/requests/GetCallRecordingV1CallsCallIdRecordingGetRequest.d.ts +9 -0
  11. package/dist/cjs/api/resources/calls/client/requests/GetCallRecordingV1CallsCallIdRecordingGetRequest.js +3 -0
  12. package/dist/cjs/api/resources/calls/client/requests/index.d.ts +1 -0
  13. package/dist/cjs/api/resources/conversations/client/Client.d.ts +19 -0
  14. package/dist/cjs/api/resources/conversations/client/Client.js +55 -0
  15. package/dist/cjs/api/resources/conversations/client/requests/SendTypingIndicatorV1ConversationsConversationIdTypingPostRequest.d.ts +9 -0
  16. package/dist/cjs/api/resources/conversations/client/requests/SendTypingIndicatorV1ConversationsConversationIdTypingPostRequest.js +3 -0
  17. package/dist/cjs/api/resources/conversations/client/requests/index.d.ts +1 -0
  18. package/dist/cjs/api/resources/usage/client/Client.d.ts +10 -0
  19. package/dist/cjs/api/resources/usage/client/Client.js +40 -0
  20. package/dist/cjs/api/types/AgentResponse.d.ts +18 -0
  21. package/dist/cjs/api/types/AgentResponse.js +12 -0
  22. package/dist/cjs/api/types/NumberUsageItem.d.ts +10 -0
  23. package/dist/cjs/api/types/NumberUsageItem.js +3 -0
  24. package/dist/cjs/api/types/NumberUsageResponse.d.ts +4 -0
  25. package/dist/cjs/api/types/NumberUsageResponse.js +3 -0
  26. package/dist/cjs/api/types/SendTypingResponse.d.ts +5 -0
  27. package/dist/cjs/api/types/SendTypingResponse.js +3 -0
  28. package/dist/cjs/api/types/index.d.ts +3 -0
  29. package/dist/cjs/api/types/index.js +3 -0
  30. package/dist/cjs/version.d.ts +1 -1
  31. package/dist/cjs/version.js +1 -1
  32. package/dist/esm/BaseClient.mjs +2 -2
  33. package/dist/esm/api/resources/agents/client/requests/CreateAgentRequest.d.mts +18 -0
  34. package/dist/esm/api/resources/agents/client/requests/CreateAgentRequest.mjs +12 -0
  35. package/dist/esm/api/resources/agents/client/requests/UpdateAgentRequest.d.mts +18 -0
  36. package/dist/esm/api/resources/agents/client/requests/UpdateAgentRequest.mjs +12 -0
  37. package/dist/esm/api/resources/calls/client/Client.d.mts +26 -0
  38. package/dist/esm/api/resources/calls/client/Client.mjs +61 -0
  39. package/dist/esm/api/resources/calls/client/requests/CreateOutboundCallRequest.d.mts +2 -0
  40. package/dist/esm/api/resources/calls/client/requests/CreateWebCallRequest.d.mts +2 -0
  41. package/dist/esm/api/resources/calls/client/requests/GetCallRecordingV1CallsCallIdRecordingGetRequest.d.mts +9 -0
  42. package/dist/esm/api/resources/calls/client/requests/GetCallRecordingV1CallsCallIdRecordingGetRequest.mjs +2 -0
  43. package/dist/esm/api/resources/calls/client/requests/index.d.mts +1 -0
  44. package/dist/esm/api/resources/conversations/client/Client.d.mts +19 -0
  45. package/dist/esm/api/resources/conversations/client/Client.mjs +55 -0
  46. package/dist/esm/api/resources/conversations/client/requests/SendTypingIndicatorV1ConversationsConversationIdTypingPostRequest.d.mts +9 -0
  47. package/dist/esm/api/resources/conversations/client/requests/SendTypingIndicatorV1ConversationsConversationIdTypingPostRequest.mjs +2 -0
  48. package/dist/esm/api/resources/conversations/client/requests/index.d.mts +1 -0
  49. package/dist/esm/api/resources/usage/client/Client.d.mts +10 -0
  50. package/dist/esm/api/resources/usage/client/Client.mjs +40 -0
  51. package/dist/esm/api/types/AgentResponse.d.mts +18 -0
  52. package/dist/esm/api/types/AgentResponse.mjs +12 -0
  53. package/dist/esm/api/types/NumberUsageItem.d.mts +10 -0
  54. package/dist/esm/api/types/NumberUsageItem.mjs +2 -0
  55. package/dist/esm/api/types/NumberUsageResponse.d.mts +4 -0
  56. package/dist/esm/api/types/NumberUsageResponse.mjs +2 -0
  57. package/dist/esm/api/types/SendTypingResponse.d.mts +5 -0
  58. package/dist/esm/api/types/SendTypingResponse.mjs +2 -0
  59. package/dist/esm/api/types/index.d.mts +3 -0
  60. package/dist/esm/api/types/index.mjs +3 -0
  61. package/dist/esm/version.d.mts +1 -1
  62. package/dist/esm/version.mjs +1 -1
  63. package/package.json +1 -1
  64. package/reference.md +200 -0
@@ -43,8 +43,8 @@ function normalizeClientOptions(options) {
43
43
  const headers = (0, headers_js_1.mergeHeaders)({
44
44
  "X-Fern-Language": "JavaScript",
45
45
  "X-Fern-SDK-Name": "agentphone",
46
- "X-Fern-SDK-Version": "1.0.5",
47
- "User-Agent": "agentphone/1.0.5",
46
+ "X-Fern-SDK-Version": "1.0.6",
47
+ "User-Agent": "agentphone/1.0.6",
48
48
  "X-Fern-Runtime": core.RUNTIME.type,
49
49
  "X-Fern-Runtime-Version": core.RUNTIME.version,
50
50
  }, options === null || options === void 0 ? void 0 : options.headers);
@@ -16,6 +16,10 @@ export interface CreateAgentRequest {
16
16
  voicemailMessage?: string | null;
17
17
  /** Speech-to-text mode. 'fast' optimizes for latency, 'accurate' optimizes for transcription accuracy (~200ms additional latency). */
18
18
  sttMode?: CreateAgentRequest.SttMode;
19
+ /** Background ambience to mask synthetic silence between turns. 'none' disables; 'office', 'coffee-shop', 'outdoor' enable a quiet bed. */
20
+ ambientSound?: CreateAgentRequest.AmbientSound;
21
+ /** Audio denoising. 'noise-cancellation' (default) handles general noise. 'noise-and-background-speech-cancellation' is more aggressive for callers in cars, cafes, or near TVs ($0.005/min surcharge). */
22
+ denoisingMode?: CreateAgentRequest.DenoisingMode;
19
23
  }
20
24
  export declare namespace CreateAgentRequest {
21
25
  const VoiceMode: {
@@ -35,4 +39,18 @@ export declare namespace CreateAgentRequest {
35
39
  readonly Accurate: "accurate";
36
40
  };
37
41
  type SttMode = (typeof SttMode)[keyof typeof SttMode];
42
+ /** Background ambience to mask synthetic silence between turns. 'none' disables; 'office', 'coffee-shop', 'outdoor' enable a quiet bed. */
43
+ const AmbientSound: {
44
+ readonly None: "none";
45
+ readonly Office: "office";
46
+ readonly CoffeeShop: "coffee-shop";
47
+ readonly Outdoor: "outdoor";
48
+ };
49
+ type AmbientSound = (typeof AmbientSound)[keyof typeof AmbientSound];
50
+ /** Audio denoising. 'noise-cancellation' (default) handles general noise. 'noise-and-background-speech-cancellation' is more aggressive for callers in cars, cafes, or near TVs ($0.005/min surcharge). */
51
+ const DenoisingMode: {
52
+ readonly NoiseCancellation: "noise-cancellation";
53
+ readonly NoiseAndBackgroundSpeechCancellation: "noise-and-background-speech-cancellation";
54
+ };
55
+ type DenoisingMode = (typeof DenoisingMode)[keyof typeof DenoisingMode];
38
56
  }
@@ -18,4 +18,16 @@ var CreateAgentRequest;
18
18
  Fast: "fast",
19
19
  Accurate: "accurate",
20
20
  };
21
+ /** Background ambience to mask synthetic silence between turns. 'none' disables; 'office', 'coffee-shop', 'outdoor' enable a quiet bed. */
22
+ CreateAgentRequest.AmbientSound = {
23
+ None: "none",
24
+ Office: "office",
25
+ CoffeeShop: "coffee-shop",
26
+ Outdoor: "outdoor",
27
+ };
28
+ /** Audio denoising. 'noise-cancellation' (default) handles general noise. 'noise-and-background-speech-cancellation' is more aggressive for callers in cars, cafes, or near TVs ($0.005/min surcharge). */
29
+ CreateAgentRequest.DenoisingMode = {
30
+ NoiseCancellation: "noise-cancellation",
31
+ NoiseAndBackgroundSpeechCancellation: "noise-and-background-speech-cancellation",
32
+ };
21
33
  })(CreateAgentRequest || (exports.CreateAgentRequest = CreateAgentRequest = {}));
@@ -17,6 +17,10 @@ export interface UpdateAgentRequest {
17
17
  voicemailMessage?: string | null;
18
18
  /** Speech-to-text mode. 'fast' optimizes for latency, 'accurate' optimizes for transcription accuracy (~200ms additional latency). */
19
19
  sttMode?: UpdateAgentRequest.SttMode;
20
+ /** Background ambience to mask synthetic silence between turns. 'none' disables; 'office', 'coffee-shop', 'outdoor' enable a quiet bed. */
21
+ ambientSound?: UpdateAgentRequest.AmbientSound;
22
+ /** Audio denoising. 'noise-cancellation' (default) handles general noise. 'noise-and-background-speech-cancellation' is more aggressive for callers in cars, cafes, or near TVs ($0.005/min surcharge). */
23
+ denoisingMode?: UpdateAgentRequest.DenoisingMode;
20
24
  }
21
25
  export declare namespace UpdateAgentRequest {
22
26
  const VoiceMode: {
@@ -36,4 +40,18 @@ export declare namespace UpdateAgentRequest {
36
40
  readonly Accurate: "accurate";
37
41
  };
38
42
  type SttMode = (typeof SttMode)[keyof typeof SttMode];
43
+ /** Background ambience to mask synthetic silence between turns. 'none' disables; 'office', 'coffee-shop', 'outdoor' enable a quiet bed. */
44
+ const AmbientSound: {
45
+ readonly None: "none";
46
+ readonly Office: "office";
47
+ readonly CoffeeShop: "coffee-shop";
48
+ readonly Outdoor: "outdoor";
49
+ };
50
+ type AmbientSound = (typeof AmbientSound)[keyof typeof AmbientSound];
51
+ /** Audio denoising. 'noise-cancellation' (default) handles general noise. 'noise-and-background-speech-cancellation' is more aggressive for callers in cars, cafes, or near TVs ($0.005/min surcharge). */
52
+ const DenoisingMode: {
53
+ readonly NoiseCancellation: "noise-cancellation";
54
+ readonly NoiseAndBackgroundSpeechCancellation: "noise-and-background-speech-cancellation";
55
+ };
56
+ type DenoisingMode = (typeof DenoisingMode)[keyof typeof DenoisingMode];
39
57
  }
@@ -18,4 +18,16 @@ var UpdateAgentRequest;
18
18
  Fast: "fast",
19
19
  Accurate: "accurate",
20
20
  };
21
+ /** Background ambience to mask synthetic silence between turns. 'none' disables; 'office', 'coffee-shop', 'outdoor' enable a quiet bed. */
22
+ UpdateAgentRequest.AmbientSound = {
23
+ None: "none",
24
+ Office: "office",
25
+ CoffeeShop: "coffee-shop",
26
+ Outdoor: "outdoor",
27
+ };
28
+ /** Audio denoising. 'noise-cancellation' (default) handles general noise. 'noise-and-background-speech-cancellation' is more aggressive for callers in cars, cafes, or near TVs ($0.005/min surcharge). */
29
+ UpdateAgentRequest.DenoisingMode = {
30
+ NoiseCancellation: "noise-cancellation",
31
+ NoiseAndBackgroundSpeechCancellation: "noise-and-background-speech-cancellation",
32
+ };
21
33
  })(UpdateAgentRequest || (exports.UpdateAgentRequest = UpdateAgentRequest = {}));
@@ -90,6 +90,32 @@ export declare class CallsClient {
90
90
  */
91
91
  getCall(request: AgentPhone.GetCallV1CallsCallIdGetRequest, requestOptions?: CallsClient.RequestOptions): core.HttpResponsePromise<unknown>;
92
92
  private __getCall;
93
+ /**
94
+ * Returns the audio file (WAV format) for a completed call.
95
+ *
96
+ * This is a public endpoint -- no authentication is required. The call ID acts as the access token. The `recordingUrl` field in the call response already contains this URL when recording is enabled.
97
+ *
98
+ * Recording must be enabled on your account via `POST /credits/recording/enable` ($5/mo add-on). Returns `404` if the call doesn't exist or has no recording.
99
+ *
100
+ * **Response:** Binary audio file (`audio/wav`), auto-downloads with filename `recording-{call_id}.wav`.
101
+ *
102
+ * **Notes:**
103
+ * - Recording is available shortly after a call completes
104
+ * - Check `recordingAvailable: true` in the call response before fetching
105
+ * - The URL can be shared or embedded directly since it requires no authentication
106
+ *
107
+ * @param {AgentPhone.GetCallRecordingV1CallsCallIdRecordingGetRequest} request
108
+ * @param {CallsClient.RequestOptions} requestOptions - Request-specific configuration.
109
+ *
110
+ * @throws {@link AgentPhone.UnprocessableEntityError}
111
+ *
112
+ * @example
113
+ * await client.calls.getCallRecording({
114
+ * call_id: "call_id"
115
+ * })
116
+ */
117
+ getCallRecording(request: AgentPhone.GetCallRecordingV1CallsCallIdRecordingGetRequest, requestOptions?: CallsClient.RequestOptions): core.HttpResponsePromise<unknown>;
118
+ private __getCallRecording;
93
119
  /**
94
120
  * Get the full transcript for a call.
95
121
  *
@@ -291,6 +291,67 @@ class CallsClient {
291
291
  return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/v1/calls/{call_id}");
292
292
  });
293
293
  }
294
+ /**
295
+ * Returns the audio file (WAV format) for a completed call.
296
+ *
297
+ * This is a public endpoint -- no authentication is required. The call ID acts as the access token. The `recordingUrl` field in the call response already contains this URL when recording is enabled.
298
+ *
299
+ * Recording must be enabled on your account via `POST /credits/recording/enable` ($5/mo add-on). Returns `404` if the call doesn't exist or has no recording.
300
+ *
301
+ * **Response:** Binary audio file (`audio/wav`), auto-downloads with filename `recording-{call_id}.wav`.
302
+ *
303
+ * **Notes:**
304
+ * - Recording is available shortly after a call completes
305
+ * - Check `recordingAvailable: true` in the call response before fetching
306
+ * - The URL can be shared or embedded directly since it requires no authentication
307
+ *
308
+ * @param {AgentPhone.GetCallRecordingV1CallsCallIdRecordingGetRequest} request
309
+ * @param {CallsClient.RequestOptions} requestOptions - Request-specific configuration.
310
+ *
311
+ * @throws {@link AgentPhone.UnprocessableEntityError}
312
+ *
313
+ * @example
314
+ * await client.calls.getCallRecording({
315
+ * call_id: "call_id"
316
+ * })
317
+ */
318
+ getCallRecording(request, requestOptions) {
319
+ return core.HttpResponsePromise.fromPromise(this.__getCallRecording(request, requestOptions));
320
+ }
321
+ __getCallRecording(request, requestOptions) {
322
+ return __awaiter(this, void 0, void 0, function* () {
323
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
324
+ const { call_id: callId } = request;
325
+ const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
326
+ const _response = yield core.fetcher({
327
+ 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.AgentPhoneEnvironment.Production, `v1/calls/${core.url.encodePathParam(callId)}/recording`),
328
+ method: "GET",
329
+ headers: _headers,
330
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
331
+ timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
332
+ maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
333
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
334
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
335
+ logging: this._options.logging,
336
+ });
337
+ if (_response.ok) {
338
+ return { data: _response.body, rawResponse: _response.rawResponse };
339
+ }
340
+ if (_response.error.reason === "status-code") {
341
+ switch (_response.error.statusCode) {
342
+ case 422:
343
+ throw new AgentPhone.UnprocessableEntityError(_response.error.body, _response.rawResponse);
344
+ default:
345
+ throw new errors.AgentPhoneError({
346
+ statusCode: _response.error.statusCode,
347
+ body: _response.error.body,
348
+ rawResponse: _response.rawResponse,
349
+ });
350
+ }
351
+ }
352
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/v1/calls/{call_id}/recording");
353
+ });
354
+ }
294
355
  /**
295
356
  * Get the full transcript for a call.
296
357
  *
@@ -18,4 +18,6 @@ export interface CreateOutboundCallRequest {
18
18
  voice?: string | null;
19
19
  /** When provided, uses a built-in LLM for the conversation instead of forwarding to a webhook. The prompt defines the AI's personality and conversation topic. */
20
20
  systemPrompt?: string | null;
21
+ /** Optional per-call dynamic variables. Values are substituted into ``{{var_name}}`` placeholders in the agent's system prompt and initial greeting at call time. Requires either ``systemPrompt`` or a hosted-mode agent. */
22
+ variables?: Record<string, string | null> | null;
21
23
  }
@@ -9,4 +9,6 @@ export interface CreateWebCallRequest {
9
9
  agentId: string;
10
10
  /** Optional metadata to attach to the call */
11
11
  metadata?: Record<string, unknown> | null;
12
+ /** Optional per-call dynamic variables. Values are substituted into ``{{var_name}}`` placeholders in the agent's system prompt and begin message at call time. Requires a hosted-mode agent. */
13
+ variables?: Record<string, string | null> | null;
12
14
  }
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * call_id: "call_id"
5
+ * }
6
+ */
7
+ export interface GetCallRecordingV1CallsCallIdRecordingGetRequest {
8
+ call_id: string;
9
+ }
@@ -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,5 +1,6 @@
1
1
  export type { CreateOutboundCallRequest } from "./CreateOutboundCallRequest.js";
2
2
  export type { CreateWebCallRequest } from "./CreateWebCallRequest.js";
3
+ export type { GetCallRecordingV1CallsCallIdRecordingGetRequest } from "./GetCallRecordingV1CallsCallIdRecordingGetRequest.js";
3
4
  export type { GetCallTranscriptV1CallsCallIdTranscriptGetRequest } from "./GetCallTranscriptV1CallsCallIdTranscriptGetRequest.js";
4
5
  export type { GetCallV1CallsCallIdGetRequest } from "./GetCallV1CallsCallIdGetRequest.js";
5
6
  export type { ListCallsForNumberV1NumbersNumberIdCallsGetRequest } from "./ListCallsForNumberV1NumbersNumberIdCallsGetRequest.js";
@@ -79,4 +79,23 @@ export declare class ConversationsClient {
79
79
  */
80
80
  getConversationMessages(request: AgentPhone.GetConversationMessagesV1ConversationsConversationIdMessagesGetRequest, requestOptions?: ConversationsClient.RequestOptions): core.HttpResponsePromise<AgentPhone.MessagesListResponse>;
81
81
  private __getConversationMessages;
82
+ /**
83
+ * Show a typing indicator in the conversation (iMessage only).
84
+ *
85
+ * Best-effort: providers may silently drop the indicator if the chat hasn't
86
+ * had recent activity, the recipient isn't on iMessage, or it's a group chat.
87
+ * Indicators auto-expire after a few seconds — no "stop typing" call needed.
88
+ *
89
+ * @param {AgentPhone.SendTypingIndicatorV1ConversationsConversationIdTypingPostRequest} request
90
+ * @param {ConversationsClient.RequestOptions} requestOptions - Request-specific configuration.
91
+ *
92
+ * @throws {@link AgentPhone.UnprocessableEntityError}
93
+ *
94
+ * @example
95
+ * await client.conversations.sendTypingIndicator({
96
+ * conversation_id: "conversation_id"
97
+ * })
98
+ */
99
+ sendTypingIndicator(request: AgentPhone.SendTypingIndicatorV1ConversationsConversationIdTypingPostRequest, requestOptions?: ConversationsClient.RequestOptions): core.HttpResponsePromise<AgentPhone.SendTypingResponse>;
100
+ private __sendTypingIndicator;
82
101
  }
@@ -297,5 +297,60 @@ class ConversationsClient {
297
297
  return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/v1/conversations/{conversation_id}/messages");
298
298
  });
299
299
  }
300
+ /**
301
+ * Show a typing indicator in the conversation (iMessage only).
302
+ *
303
+ * Best-effort: providers may silently drop the indicator if the chat hasn't
304
+ * had recent activity, the recipient isn't on iMessage, or it's a group chat.
305
+ * Indicators auto-expire after a few seconds — no "stop typing" call needed.
306
+ *
307
+ * @param {AgentPhone.SendTypingIndicatorV1ConversationsConversationIdTypingPostRequest} request
308
+ * @param {ConversationsClient.RequestOptions} requestOptions - Request-specific configuration.
309
+ *
310
+ * @throws {@link AgentPhone.UnprocessableEntityError}
311
+ *
312
+ * @example
313
+ * await client.conversations.sendTypingIndicator({
314
+ * conversation_id: "conversation_id"
315
+ * })
316
+ */
317
+ sendTypingIndicator(request, requestOptions) {
318
+ return core.HttpResponsePromise.fromPromise(this.__sendTypingIndicator(request, requestOptions));
319
+ }
320
+ __sendTypingIndicator(request, requestOptions) {
321
+ return __awaiter(this, void 0, void 0, function* () {
322
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
323
+ const { conversation_id: conversationId } = request;
324
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
325
+ 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);
326
+ const _response = yield core.fetcher({
327
+ 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.AgentPhoneEnvironment.Production, `v1/conversations/${core.url.encodePathParam(conversationId)}/typing`),
328
+ method: "POST",
329
+ headers: _headers,
330
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
331
+ timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
332
+ maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
333
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
334
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
335
+ logging: this._options.logging,
336
+ });
337
+ if (_response.ok) {
338
+ return { data: _response.body, rawResponse: _response.rawResponse };
339
+ }
340
+ if (_response.error.reason === "status-code") {
341
+ switch (_response.error.statusCode) {
342
+ case 422:
343
+ throw new AgentPhone.UnprocessableEntityError(_response.error.body, _response.rawResponse);
344
+ default:
345
+ throw new errors.AgentPhoneError({
346
+ statusCode: _response.error.statusCode,
347
+ body: _response.error.body,
348
+ rawResponse: _response.rawResponse,
349
+ });
350
+ }
351
+ }
352
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/v1/conversations/{conversation_id}/typing");
353
+ });
354
+ }
300
355
  }
301
356
  exports.ConversationsClient = ConversationsClient;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * conversation_id: "conversation_id"
5
+ * }
6
+ */
7
+ export interface SendTypingIndicatorV1ConversationsConversationIdTypingPostRequest {
8
+ conversation_id: string;
9
+ }
@@ -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,4 +1,5 @@
1
1
  export type { GetConversationMessagesV1ConversationsConversationIdMessagesGetRequest } from "./GetConversationMessagesV1ConversationsConversationIdMessagesGetRequest.js";
2
2
  export type { GetConversationV1ConversationsConversationIdGetRequest } from "./GetConversationV1ConversationsConversationIdGetRequest.js";
3
3
  export type { ListConversationsV1ConversationsGetRequest } from "./ListConversationsV1ConversationsGetRequest.js";
4
+ export type { SendTypingIndicatorV1ConversationsConversationIdTypingPostRequest } from "./SendTypingIndicatorV1ConversationsConversationIdTypingPostRequest.js";
4
5
  export type { UpdateConversationRequest } from "./UpdateConversationRequest.js";
@@ -54,4 +54,14 @@ export declare class UsageClient {
54
54
  */
55
55
  getMonthlyUsage(request?: AgentPhone.GetMonthlyUsageV1UsageMonthlyGetRequest, requestOptions?: UsageClient.RequestOptions): core.HttpResponsePromise<AgentPhone.MonthlyUsageResponse>;
56
56
  private __getMonthlyUsage;
57
+ /**
58
+ * Get usage statistics broken down by phone number, with linked agent info.
59
+ *
60
+ * @param {UsageClient.RequestOptions} requestOptions - Request-specific configuration.
61
+ *
62
+ * @example
63
+ * await client.usage.getUsageByNumber()
64
+ */
65
+ getUsageByNumber(requestOptions?: UsageClient.RequestOptions): core.HttpResponsePromise<AgentPhone.NumberUsageResponse>;
66
+ private __getUsageByNumber;
57
67
  }
@@ -207,5 +207,45 @@ class UsageClient {
207
207
  return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/v1/usage/monthly");
208
208
  });
209
209
  }
210
+ /**
211
+ * Get usage statistics broken down by phone number, with linked agent info.
212
+ *
213
+ * @param {UsageClient.RequestOptions} requestOptions - Request-specific configuration.
214
+ *
215
+ * @example
216
+ * await client.usage.getUsageByNumber()
217
+ */
218
+ getUsageByNumber(requestOptions) {
219
+ return core.HttpResponsePromise.fromPromise(this.__getUsageByNumber(requestOptions));
220
+ }
221
+ __getUsageByNumber(requestOptions) {
222
+ return __awaiter(this, void 0, void 0, function* () {
223
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
224
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
225
+ 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);
226
+ const _response = yield core.fetcher({
227
+ 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.AgentPhoneEnvironment.Production, "v1/usage/by-number"),
228
+ method: "GET",
229
+ headers: _headers,
230
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
231
+ timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
232
+ maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
233
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
234
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
235
+ logging: this._options.logging,
236
+ });
237
+ if (_response.ok) {
238
+ return { data: _response.body, rawResponse: _response.rawResponse };
239
+ }
240
+ if (_response.error.reason === "status-code") {
241
+ throw new errors.AgentPhoneError({
242
+ statusCode: _response.error.statusCode,
243
+ body: _response.error.body,
244
+ rawResponse: _response.rawResponse,
245
+ });
246
+ }
247
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/v1/usage/by-number");
248
+ });
249
+ }
210
250
  }
211
251
  exports.UsageClient = UsageClient;
@@ -12,6 +12,10 @@ export interface AgentResponse {
12
12
  voicemailMessage?: string | null;
13
13
  /** Speech-to-text mode. 'fast' optimizes for latency, 'accurate' optimizes for transcription accuracy (~200ms additional latency). */
14
14
  sttMode?: AgentResponse.SttMode;
15
+ /** Background ambience to mask synthetic silence between turns. 'none' disables; 'office', 'coffee-shop', 'outdoor' enable a quiet bed. */
16
+ ambientSound?: AgentResponse.AmbientSound;
17
+ /** Audio denoising. 'noise-cancellation' (default) handles general noise. 'noise-and-background-speech-cancellation' is more aggressive for callers in cars, cafes, or near TVs ($0.005/min surcharge). */
18
+ denoisingMode?: AgentResponse.DenoisingMode;
15
19
  createdAt: string;
16
20
  numbers?: AgentPhone.AgentNumberResponse[] | null;
17
21
  }
@@ -33,4 +37,18 @@ export declare namespace AgentResponse {
33
37
  readonly Accurate: "accurate";
34
38
  };
35
39
  type SttMode = (typeof SttMode)[keyof typeof SttMode];
40
+ /** Background ambience to mask synthetic silence between turns. 'none' disables; 'office', 'coffee-shop', 'outdoor' enable a quiet bed. */
41
+ const AmbientSound: {
42
+ readonly None: "none";
43
+ readonly Office: "office";
44
+ readonly CoffeeShop: "coffee-shop";
45
+ readonly Outdoor: "outdoor";
46
+ };
47
+ type AmbientSound = (typeof AmbientSound)[keyof typeof AmbientSound];
48
+ /** Audio denoising. 'noise-cancellation' (default) handles general noise. 'noise-and-background-speech-cancellation' is more aggressive for callers in cars, cafes, or near TVs ($0.005/min surcharge). */
49
+ const DenoisingMode: {
50
+ readonly NoiseCancellation: "noise-cancellation";
51
+ readonly NoiseAndBackgroundSpeechCancellation: "noise-and-background-speech-cancellation";
52
+ };
53
+ type DenoisingMode = (typeof DenoisingMode)[keyof typeof DenoisingMode];
36
54
  }
@@ -18,4 +18,16 @@ var AgentResponse;
18
18
  Fast: "fast",
19
19
  Accurate: "accurate",
20
20
  };
21
+ /** Background ambience to mask synthetic silence between turns. 'none' disables; 'office', 'coffee-shop', 'outdoor' enable a quiet bed. */
22
+ AgentResponse.AmbientSound = {
23
+ None: "none",
24
+ Office: "office",
25
+ CoffeeShop: "coffee-shop",
26
+ Outdoor: "outdoor",
27
+ };
28
+ /** Audio denoising. 'noise-cancellation' (default) handles general noise. 'noise-and-background-speech-cancellation' is more aggressive for callers in cars, cafes, or near TVs ($0.005/min surcharge). */
29
+ AgentResponse.DenoisingMode = {
30
+ NoiseCancellation: "noise-cancellation",
31
+ NoiseAndBackgroundSpeechCancellation: "noise-and-background-speech-cancellation",
32
+ };
21
33
  })(AgentResponse || (exports.AgentResponse = AgentResponse = {}));
@@ -0,0 +1,10 @@
1
+ export interface NumberUsageItem {
2
+ numberId: string;
3
+ phoneNumber: string;
4
+ country: string;
5
+ status: string;
6
+ agentId?: string | null;
7
+ agentName?: string | null;
8
+ messages: number;
9
+ calls: number;
10
+ }
@@ -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,4 @@
1
+ import type * as AgentPhone from "../index.js";
2
+ export interface NumberUsageResponse {
3
+ data: AgentPhone.NumberUsageItem[];
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
+ export interface SendTypingResponse {
2
+ conversationId: string;
3
+ channel: string;
4
+ status: string;
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 });
@@ -23,6 +23,8 @@ export * from "./MessagesListResponse.js";
23
23
  export * from "./MonthlyUsagePoint.js";
24
24
  export * from "./MonthlyUsageResponse.js";
25
25
  export * from "./NumberLimits.js";
26
+ export * from "./NumberUsageItem.js";
27
+ export * from "./NumberUsageResponse.js";
26
28
  export * from "./PaginatedDeliveriesResponse.js";
27
29
  export * from "./PhoneNumberListResponse.js";
28
30
  export * from "./PhoneNumberResponse.js";
@@ -31,6 +33,7 @@ export * from "./PlanLimits.js";
31
33
  export * from "./ReactionInConversation.js";
32
34
  export * from "./SendMessageResponse.js";
33
35
  export * from "./SendReactionResponse.js";
36
+ export * from "./SendTypingResponse.js";
34
37
  export * from "./UsageResponse.js";
35
38
  export * from "./UsageStats.js";
36
39
  export * from "./ValidationError.js";
@@ -39,6 +39,8 @@ __exportStar(require("./MessagesListResponse.js"), exports);
39
39
  __exportStar(require("./MonthlyUsagePoint.js"), exports);
40
40
  __exportStar(require("./MonthlyUsageResponse.js"), exports);
41
41
  __exportStar(require("./NumberLimits.js"), exports);
42
+ __exportStar(require("./NumberUsageItem.js"), exports);
43
+ __exportStar(require("./NumberUsageResponse.js"), exports);
42
44
  __exportStar(require("./PaginatedDeliveriesResponse.js"), exports);
43
45
  __exportStar(require("./PhoneNumberListResponse.js"), exports);
44
46
  __exportStar(require("./PhoneNumberResponse.js"), exports);
@@ -47,6 +49,7 @@ __exportStar(require("./PlanLimits.js"), exports);
47
49
  __exportStar(require("./ReactionInConversation.js"), exports);
48
50
  __exportStar(require("./SendMessageResponse.js"), exports);
49
51
  __exportStar(require("./SendReactionResponse.js"), exports);
52
+ __exportStar(require("./SendTypingResponse.js"), exports);
50
53
  __exportStar(require("./UsageResponse.js"), exports);
51
54
  __exportStar(require("./UsageStats.js"), exports);
52
55
  __exportStar(require("./ValidationError.js"), exports);
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "1.0.5";
1
+ export declare const SDK_VERSION = "1.0.6";
@@ -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 = "1.0.5";
4
+ exports.SDK_VERSION = "1.0.6";
@@ -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": "agentphone",
9
- "X-Fern-SDK-Version": "1.0.5",
10
- "User-Agent": "agentphone/1.0.5",
9
+ "X-Fern-SDK-Version": "1.0.6",
10
+ "User-Agent": "agentphone/1.0.6",
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);
@@ -16,6 +16,10 @@ export interface CreateAgentRequest {
16
16
  voicemailMessage?: string | null;
17
17
  /** Speech-to-text mode. 'fast' optimizes for latency, 'accurate' optimizes for transcription accuracy (~200ms additional latency). */
18
18
  sttMode?: CreateAgentRequest.SttMode;
19
+ /** Background ambience to mask synthetic silence between turns. 'none' disables; 'office', 'coffee-shop', 'outdoor' enable a quiet bed. */
20
+ ambientSound?: CreateAgentRequest.AmbientSound;
21
+ /** Audio denoising. 'noise-cancellation' (default) handles general noise. 'noise-and-background-speech-cancellation' is more aggressive for callers in cars, cafes, or near TVs ($0.005/min surcharge). */
22
+ denoisingMode?: CreateAgentRequest.DenoisingMode;
19
23
  }
20
24
  export declare namespace CreateAgentRequest {
21
25
  const VoiceMode: {
@@ -35,4 +39,18 @@ export declare namespace CreateAgentRequest {
35
39
  readonly Accurate: "accurate";
36
40
  };
37
41
  type SttMode = (typeof SttMode)[keyof typeof SttMode];
42
+ /** Background ambience to mask synthetic silence between turns. 'none' disables; 'office', 'coffee-shop', 'outdoor' enable a quiet bed. */
43
+ const AmbientSound: {
44
+ readonly None: "none";
45
+ readonly Office: "office";
46
+ readonly CoffeeShop: "coffee-shop";
47
+ readonly Outdoor: "outdoor";
48
+ };
49
+ type AmbientSound = (typeof AmbientSound)[keyof typeof AmbientSound];
50
+ /** Audio denoising. 'noise-cancellation' (default) handles general noise. 'noise-and-background-speech-cancellation' is more aggressive for callers in cars, cafes, or near TVs ($0.005/min surcharge). */
51
+ const DenoisingMode: {
52
+ readonly NoiseCancellation: "noise-cancellation";
53
+ readonly NoiseAndBackgroundSpeechCancellation: "noise-and-background-speech-cancellation";
54
+ };
55
+ type DenoisingMode = (typeof DenoisingMode)[keyof typeof DenoisingMode];
38
56
  }
@@ -15,4 +15,16 @@ export var CreateAgentRequest;
15
15
  Fast: "fast",
16
16
  Accurate: "accurate",
17
17
  };
18
+ /** Background ambience to mask synthetic silence between turns. 'none' disables; 'office', 'coffee-shop', 'outdoor' enable a quiet bed. */
19
+ CreateAgentRequest.AmbientSound = {
20
+ None: "none",
21
+ Office: "office",
22
+ CoffeeShop: "coffee-shop",
23
+ Outdoor: "outdoor",
24
+ };
25
+ /** Audio denoising. 'noise-cancellation' (default) handles general noise. 'noise-and-background-speech-cancellation' is more aggressive for callers in cars, cafes, or near TVs ($0.005/min surcharge). */
26
+ CreateAgentRequest.DenoisingMode = {
27
+ NoiseCancellation: "noise-cancellation",
28
+ NoiseAndBackgroundSpeechCancellation: "noise-and-background-speech-cancellation",
29
+ };
18
30
  })(CreateAgentRequest || (CreateAgentRequest = {}));