phonic 0.32.22 → 0.32.24

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 (33) hide show
  1. package/dist/cjs/BaseClient.js +2 -2
  2. package/dist/cjs/api/resources/tools/client/requests/CreateToolRequest.d.ts +2 -0
  3. package/dist/cjs/api/resources/tools/client/requests/UpdateToolRequest.d.ts +2 -0
  4. package/dist/cjs/api/types/Conversation.d.ts +1 -1
  5. package/dist/cjs/api/types/GeneratedToolCall.d.ts +2 -2
  6. package/dist/cjs/api/types/GeneratedToolReference.d.ts +7 -0
  7. package/dist/cjs/api/types/GeneratedToolReference.js +3 -0
  8. package/dist/cjs/api/types/InlineWebSocketTool.d.ts +2 -0
  9. package/dist/cjs/api/types/ResponsesToolCall.d.ts +2 -2
  10. package/dist/cjs/api/types/ResponsesToolReference.d.ts +9 -0
  11. package/dist/cjs/api/types/ResponsesToolReference.js +3 -0
  12. package/dist/cjs/api/types/ToolParametersJsonSchema.d.ts +1 -1
  13. package/dist/cjs/api/types/index.d.ts +2 -0
  14. package/dist/cjs/api/types/index.js +2 -0
  15. package/dist/cjs/version.d.ts +1 -1
  16. package/dist/cjs/version.js +1 -1
  17. package/dist/esm/BaseClient.mjs +2 -2
  18. package/dist/esm/api/resources/tools/client/requests/CreateToolRequest.d.mts +2 -0
  19. package/dist/esm/api/resources/tools/client/requests/UpdateToolRequest.d.mts +2 -0
  20. package/dist/esm/api/types/Conversation.d.mts +1 -1
  21. package/dist/esm/api/types/GeneratedToolCall.d.mts +2 -2
  22. package/dist/esm/api/types/GeneratedToolReference.d.mts +7 -0
  23. package/dist/esm/api/types/GeneratedToolReference.mjs +2 -0
  24. package/dist/esm/api/types/InlineWebSocketTool.d.mts +2 -0
  25. package/dist/esm/api/types/ResponsesToolCall.d.mts +2 -2
  26. package/dist/esm/api/types/ResponsesToolReference.d.mts +9 -0
  27. package/dist/esm/api/types/ResponsesToolReference.mjs +2 -0
  28. package/dist/esm/api/types/ToolParametersJsonSchema.d.mts +1 -1
  29. package/dist/esm/api/types/index.d.mts +2 -0
  30. package/dist/esm/api/types/index.mjs +2 -0
  31. package/dist/esm/version.d.mts +1 -1
  32. package/dist/esm/version.mjs +1 -1
  33. package/package.json +1 -1
@@ -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": "phonic",
46
- "X-Fern-SDK-Version": "0.32.22",
47
- "User-Agent": "phonic/0.32.22",
46
+ "X-Fern-SDK-Version": "0.32.24",
47
+ "User-Agent": "phonic/0.32.24",
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);
@@ -233,6 +233,8 @@ export interface CreateToolRequest {
233
233
  allow_tool_chaining?: boolean;
234
234
  /** The agent doesn't typically wait for the response of async tools. When true, makes the agent wait for a response, not call other tools and inform the user of the result. Only available for async custom_webhook and custom_websocket tools, and cannot be combined with allow_tool_chaining set to true. */
235
235
  wait_for_response?: boolean;
236
+ /** When true, the user cannot interrupt the agent while the tool call is in flight; the agent's turn is held open until the tool returns. Only available for sync custom_webhook and custom_websocket tools. */
237
+ uninterruptible?: boolean;
236
238
  /** The static context returned to the agent. Required for custom_context tools. */
237
239
  context?: string;
238
240
  }
@@ -73,6 +73,8 @@ export interface UpdateToolRequest {
73
73
  allow_tool_chaining?: boolean;
74
74
  /** The agent doesn't typically wait for the response of async tools. When true, makes the agent wait for a response, not call other tools and inform the user of the result. Only available for async custom_webhook and custom_websocket tools, and cannot be combined with allow_tool_chaining set to true. */
75
75
  wait_for_response?: boolean;
76
+ /** When true, the user cannot interrupt the agent while the tool call is in flight; the agent's turn is held open until the tool returns. Only available for sync custom_webhook and custom_websocket tools, so the resulting execution_mode must be sync. */
77
+ uninterruptible?: boolean;
76
78
  }
77
79
  export declare namespace UpdateToolRequest {
78
80
  /** Mode of operation. */
@@ -181,7 +181,7 @@ export declare namespace Conversation {
181
181
  * Phone call metadata. `null` for non-phone call conversations.
182
182
  */
183
183
  interface CallInfo {
184
- /** Caller phone number in E.164 format. */
184
+ /** Caller phone number in E.164 format. `"anonymous"` for inbound calls whose caller withheld their number. */
185
185
  from_phone_number: string;
186
186
  /** Callee phone number in E.164 format. */
187
187
  to_phone_number: string;
@@ -1,8 +1,8 @@
1
+ import type * as Phonic from "../index.js";
1
2
  export interface GeneratedToolCall {
2
3
  /** Identifier for this tool call. Send it back as the `tool_call_id` of the matching `tool_call_output` input item. */
3
4
  tool_call_id: string;
4
- /** Name of the tool to call. Always one of the `tool_definitions` from the request. */
5
- tool_name: string;
5
+ tool: Phonic.GeneratedToolReference;
6
6
  /** Arguments the assistant produced for the request body. */
7
7
  request_body?: Record<string, unknown> | undefined;
8
8
  /** Arguments the assistant produced as query parameters. */
@@ -0,0 +1,7 @@
1
+ /**
2
+ * The tool the assistant wants to call.
3
+ */
4
+ export interface GeneratedToolReference {
5
+ /** Name of the tool to call. Always one of the `tool_definitions` from the request. */
6
+ name: string;
7
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -21,6 +21,8 @@ export interface InlineWebSocketTool {
21
21
  allow_tool_chaining?: boolean | undefined;
22
22
  /** For async tools, when true, the assistant waits for the response and speaks when it arrives. */
23
23
  wait_for_response?: boolean | undefined;
24
+ /** For sync tools, when true, the user cannot interrupt the assistant while the tool call is in flight; the assistant's turn is held open until the tool returns. */
25
+ uninterruptible?: boolean | undefined;
24
26
  }
25
27
  export declare namespace InlineWebSocketTool {
26
28
  /** Whether the assistant waits for the tool output before continuing. */
@@ -1,11 +1,11 @@
1
+ import type * as Phonic from "../index.js";
1
2
  /**
2
3
  * A tool call the assistant made earlier in the conversation.
3
4
  */
4
5
  export interface ResponsesToolCall {
5
6
  /** Identifier for this tool call, unique within `input`. */
6
7
  tool_call_id: string;
7
- /** Name of the called tool. */
8
- tool_name: string;
8
+ tool: Phonic.ResponsesToolReference;
9
9
  /** Arguments the assistant passed in the request body. */
10
10
  request_body?: (Record<string, unknown> | null) | undefined;
11
11
  /** Arguments the assistant passed as query parameters. An argument cannot appear in both `request_body` and `query_params`. */
@@ -0,0 +1,9 @@
1
+ /**
2
+ * A pointer to the tool that was called by the assistant (see ResponsesToolCall).
3
+ */
4
+ export interface ResponsesToolReference {
5
+ /** Optional tool ID, accepted for compatibility with tool calls copied from conversation items. */
6
+ id?: string | undefined;
7
+ /** Name of the tool that was called. */
8
+ name: 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,7 +1,7 @@
1
1
  /**
2
2
  * A tool's parameters expressed as a raw JSON Schema object, for parameters that the flat `ToolParameter` list cannot express: nested objects, arrays of objects, `anyOf` variants, `null`, and non-string enums.
3
3
  * Each entry in `properties` is a JSON Schema value supporting `type` (`"string"`, `"integer"`, `"number"`, `"boolean"`, `"null"`, `"array"`, `"object"`), `description`, `enum` (string parameters only), `items` (for arrays), `properties`/`required`/`additionalProperties` (for objects) and `anyOf`. Values may be nested up to 5 levels deep.
4
- * Parameter names cannot be any of the reserved names that Phonic injects into every tool call: `call_info`, `conversation_id`, `from_phone_number`, `to_phone_number`, `twilio_call_sid`.
4
+ * Parameter names cannot be any of the reserved names that Phonic injects into every tool call: `call_info`, `conversation_id`, `from_phone_number`, `pre_tool_text`, `to_phone_number`, `twilio_call_sid`.
5
5
  * For `custom_webhook` tools, parameter placement is supplied separately in `parameter_locations` rather than inline on the schema.
6
6
  */
7
7
  export interface ToolParametersJsonSchema {
@@ -40,6 +40,7 @@ export * from "./ExtractionField.js";
40
40
  export * from "./ExtractionSchema.js";
41
41
  export * from "./GeneratedResponse.js";
42
42
  export * from "./GeneratedToolCall.js";
43
+ export * from "./GeneratedToolReference.js";
43
44
  export * from "./GenerateReplyPayload.js";
44
45
  export * from "./GenerateResponsesResponse.js";
45
46
  export * from "./InlineWebSocketTool.js";
@@ -64,6 +65,7 @@ export * from "./ResponsesInputItem.js";
64
65
  export * from "./ResponsesToolCall.js";
65
66
  export * from "./ResponsesToolCallOutput.js";
66
67
  export * from "./ResponsesToolDefinition.js";
68
+ export * from "./ResponsesToolReference.js";
67
69
  export * from "./ResponsesUserMessage.js";
68
70
  export * from "./SayPayload.js";
69
71
  export * from "./SetExternalIdPayload.js";
@@ -56,6 +56,7 @@ __exportStar(require("./ExtractionField.js"), exports);
56
56
  __exportStar(require("./ExtractionSchema.js"), exports);
57
57
  __exportStar(require("./GeneratedResponse.js"), exports);
58
58
  __exportStar(require("./GeneratedToolCall.js"), exports);
59
+ __exportStar(require("./GeneratedToolReference.js"), exports);
59
60
  __exportStar(require("./GenerateReplyPayload.js"), exports);
60
61
  __exportStar(require("./GenerateResponsesResponse.js"), exports);
61
62
  __exportStar(require("./InlineWebSocketTool.js"), exports);
@@ -80,6 +81,7 @@ __exportStar(require("./ResponsesInputItem.js"), exports);
80
81
  __exportStar(require("./ResponsesToolCall.js"), exports);
81
82
  __exportStar(require("./ResponsesToolCallOutput.js"), exports);
82
83
  __exportStar(require("./ResponsesToolDefinition.js"), exports);
84
+ __exportStar(require("./ResponsesToolReference.js"), exports);
83
85
  __exportStar(require("./ResponsesUserMessage.js"), exports);
84
86
  __exportStar(require("./SayPayload.js"), exports);
85
87
  __exportStar(require("./SetExternalIdPayload.js"), exports);
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.32.22";
1
+ export declare const SDK_VERSION = "0.32.24";
@@ -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.32.22";
4
+ exports.SDK_VERSION = "0.32.24";
@@ -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.32.22",
10
- "User-Agent": "phonic/0.32.22",
9
+ "X-Fern-SDK-Version": "0.32.24",
10
+ "User-Agent": "phonic/0.32.24",
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);
@@ -233,6 +233,8 @@ export interface CreateToolRequest {
233
233
  allow_tool_chaining?: boolean;
234
234
  /** The agent doesn't typically wait for the response of async tools. When true, makes the agent wait for a response, not call other tools and inform the user of the result. Only available for async custom_webhook and custom_websocket tools, and cannot be combined with allow_tool_chaining set to true. */
235
235
  wait_for_response?: boolean;
236
+ /** When true, the user cannot interrupt the agent while the tool call is in flight; the agent's turn is held open until the tool returns. Only available for sync custom_webhook and custom_websocket tools. */
237
+ uninterruptible?: boolean;
236
238
  /** The static context returned to the agent. Required for custom_context tools. */
237
239
  context?: string;
238
240
  }
@@ -73,6 +73,8 @@ export interface UpdateToolRequest {
73
73
  allow_tool_chaining?: boolean;
74
74
  /** The agent doesn't typically wait for the response of async tools. When true, makes the agent wait for a response, not call other tools and inform the user of the result. Only available for async custom_webhook and custom_websocket tools, and cannot be combined with allow_tool_chaining set to true. */
75
75
  wait_for_response?: boolean;
76
+ /** When true, the user cannot interrupt the agent while the tool call is in flight; the agent's turn is held open until the tool returns. Only available for sync custom_webhook and custom_websocket tools, so the resulting execution_mode must be sync. */
77
+ uninterruptible?: boolean;
76
78
  }
77
79
  export declare namespace UpdateToolRequest {
78
80
  /** Mode of operation. */
@@ -181,7 +181,7 @@ export declare namespace Conversation {
181
181
  * Phone call metadata. `null` for non-phone call conversations.
182
182
  */
183
183
  interface CallInfo {
184
- /** Caller phone number in E.164 format. */
184
+ /** Caller phone number in E.164 format. `"anonymous"` for inbound calls whose caller withheld their number. */
185
185
  from_phone_number: string;
186
186
  /** Callee phone number in E.164 format. */
187
187
  to_phone_number: string;
@@ -1,8 +1,8 @@
1
+ import type * as Phonic from "../index.mjs";
1
2
  export interface GeneratedToolCall {
2
3
  /** Identifier for this tool call. Send it back as the `tool_call_id` of the matching `tool_call_output` input item. */
3
4
  tool_call_id: string;
4
- /** Name of the tool to call. Always one of the `tool_definitions` from the request. */
5
- tool_name: string;
5
+ tool: Phonic.GeneratedToolReference;
6
6
  /** Arguments the assistant produced for the request body. */
7
7
  request_body?: Record<string, unknown> | undefined;
8
8
  /** Arguments the assistant produced as query parameters. */
@@ -0,0 +1,7 @@
1
+ /**
2
+ * The tool the assistant wants to call.
3
+ */
4
+ export interface GeneratedToolReference {
5
+ /** Name of the tool to call. Always one of the `tool_definitions` from the request. */
6
+ name: string;
7
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -21,6 +21,8 @@ export interface InlineWebSocketTool {
21
21
  allow_tool_chaining?: boolean | undefined;
22
22
  /** For async tools, when true, the assistant waits for the response and speaks when it arrives. */
23
23
  wait_for_response?: boolean | undefined;
24
+ /** For sync tools, when true, the user cannot interrupt the assistant while the tool call is in flight; the assistant's turn is held open until the tool returns. */
25
+ uninterruptible?: boolean | undefined;
24
26
  }
25
27
  export declare namespace InlineWebSocketTool {
26
28
  /** Whether the assistant waits for the tool output before continuing. */
@@ -1,11 +1,11 @@
1
+ import type * as Phonic from "../index.mjs";
1
2
  /**
2
3
  * A tool call the assistant made earlier in the conversation.
3
4
  */
4
5
  export interface ResponsesToolCall {
5
6
  /** Identifier for this tool call, unique within `input`. */
6
7
  tool_call_id: string;
7
- /** Name of the called tool. */
8
- tool_name: string;
8
+ tool: Phonic.ResponsesToolReference;
9
9
  /** Arguments the assistant passed in the request body. */
10
10
  request_body?: (Record<string, unknown> | null) | undefined;
11
11
  /** Arguments the assistant passed as query parameters. An argument cannot appear in both `request_body` and `query_params`. */
@@ -0,0 +1,9 @@
1
+ /**
2
+ * A pointer to the tool that was called by the assistant (see ResponsesToolCall).
3
+ */
4
+ export interface ResponsesToolReference {
5
+ /** Optional tool ID, accepted for compatibility with tool calls copied from conversation items. */
6
+ id?: string | undefined;
7
+ /** Name of the tool that was called. */
8
+ name: string;
9
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * A tool's parameters expressed as a raw JSON Schema object, for parameters that the flat `ToolParameter` list cannot express: nested objects, arrays of objects, `anyOf` variants, `null`, and non-string enums.
3
3
  * Each entry in `properties` is a JSON Schema value supporting `type` (`"string"`, `"integer"`, `"number"`, `"boolean"`, `"null"`, `"array"`, `"object"`), `description`, `enum` (string parameters only), `items` (for arrays), `properties`/`required`/`additionalProperties` (for objects) and `anyOf`. Values may be nested up to 5 levels deep.
4
- * Parameter names cannot be any of the reserved names that Phonic injects into every tool call: `call_info`, `conversation_id`, `from_phone_number`, `to_phone_number`, `twilio_call_sid`.
4
+ * Parameter names cannot be any of the reserved names that Phonic injects into every tool call: `call_info`, `conversation_id`, `from_phone_number`, `pre_tool_text`, `to_phone_number`, `twilio_call_sid`.
5
5
  * For `custom_webhook` tools, parameter placement is supplied separately in `parameter_locations` rather than inline on the schema.
6
6
  */
7
7
  export interface ToolParametersJsonSchema {
@@ -40,6 +40,7 @@ export * from "./ExtractionField.mjs";
40
40
  export * from "./ExtractionSchema.mjs";
41
41
  export * from "./GeneratedResponse.mjs";
42
42
  export * from "./GeneratedToolCall.mjs";
43
+ export * from "./GeneratedToolReference.mjs";
43
44
  export * from "./GenerateReplyPayload.mjs";
44
45
  export * from "./GenerateResponsesResponse.mjs";
45
46
  export * from "./InlineWebSocketTool.mjs";
@@ -64,6 +65,7 @@ export * from "./ResponsesInputItem.mjs";
64
65
  export * from "./ResponsesToolCall.mjs";
65
66
  export * from "./ResponsesToolCallOutput.mjs";
66
67
  export * from "./ResponsesToolDefinition.mjs";
68
+ export * from "./ResponsesToolReference.mjs";
67
69
  export * from "./ResponsesUserMessage.mjs";
68
70
  export * from "./SayPayload.mjs";
69
71
  export * from "./SetExternalIdPayload.mjs";
@@ -40,6 +40,7 @@ export * from "./ExtractionField.mjs";
40
40
  export * from "./ExtractionSchema.mjs";
41
41
  export * from "./GeneratedResponse.mjs";
42
42
  export * from "./GeneratedToolCall.mjs";
43
+ export * from "./GeneratedToolReference.mjs";
43
44
  export * from "./GenerateReplyPayload.mjs";
44
45
  export * from "./GenerateResponsesResponse.mjs";
45
46
  export * from "./InlineWebSocketTool.mjs";
@@ -64,6 +65,7 @@ export * from "./ResponsesInputItem.mjs";
64
65
  export * from "./ResponsesToolCall.mjs";
65
66
  export * from "./ResponsesToolCallOutput.mjs";
66
67
  export * from "./ResponsesToolDefinition.mjs";
68
+ export * from "./ResponsesToolReference.mjs";
67
69
  export * from "./ResponsesUserMessage.mjs";
68
70
  export * from "./SayPayload.mjs";
69
71
  export * from "./SetExternalIdPayload.mjs";
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.32.22";
1
+ export declare const SDK_VERSION = "0.32.24";
@@ -1 +1 @@
1
- export const SDK_VERSION = "0.32.22";
1
+ export const SDK_VERSION = "0.32.24";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "phonic",
3
- "version": "0.32.22",
3
+ "version": "0.32.24",
4
4
  "private": false,
5
5
  "repository": {
6
6
  "type": "git",