phonic 0.32.11 → 0.32.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 (138) hide show
  1. package/dist/cjs/BaseClient.js +2 -2
  2. package/dist/cjs/Client.d.ts +3 -0
  3. package/dist/cjs/Client.js +17 -12
  4. package/dist/cjs/api/resources/agents/client/Client.d.ts +3 -0
  5. package/dist/cjs/api/resources/agents/client/Client.js +3 -0
  6. package/dist/cjs/api/resources/agents/client/requests/AgentsAddCustomPhoneNumberRequest.d.ts +10 -7
  7. package/dist/cjs/api/resources/agents/client/requests/AgentsCreateRequest.d.ts +3 -1
  8. package/dist/cjs/api/resources/agents/client/requests/AgentsUpdatePhoneNumberRequest.d.ts +1 -1
  9. package/dist/cjs/api/resources/agents/client/requests/UpdateAgentRequest.d.ts +4 -2
  10. package/dist/cjs/api/resources/externalStoragePolicies/client/Client.d.ts +117 -0
  11. package/dist/cjs/api/resources/externalStoragePolicies/client/Client.js +427 -0
  12. package/dist/cjs/api/resources/externalStoragePolicies/client/index.d.ts +1 -0
  13. package/dist/cjs/api/resources/externalStoragePolicies/client/index.js +17 -0
  14. package/dist/cjs/api/resources/externalStoragePolicies/client/requests/CreateExternalStoragePolicyRequest.d.ts +43 -0
  15. package/dist/cjs/api/resources/externalStoragePolicies/client/requests/CreateExternalStoragePolicyRequest.js +13 -0
  16. package/dist/cjs/api/resources/externalStoragePolicies/client/requests/ExternalStoragePoliciesDeleteRequest.d.ts +10 -0
  17. package/dist/cjs/api/resources/externalStoragePolicies/client/requests/ExternalStoragePoliciesDeleteRequest.js +3 -0
  18. package/dist/cjs/api/resources/externalStoragePolicies/client/requests/ExternalStoragePoliciesGetRequest.d.ts +10 -0
  19. package/dist/cjs/api/resources/externalStoragePolicies/client/requests/ExternalStoragePoliciesGetRequest.js +3 -0
  20. package/dist/cjs/api/resources/externalStoragePolicies/client/requests/ExternalStoragePoliciesListRequest.d.ts +10 -0
  21. package/dist/cjs/api/resources/externalStoragePolicies/client/requests/ExternalStoragePoliciesListRequest.js +3 -0
  22. package/dist/cjs/api/resources/externalStoragePolicies/client/requests/UpdateExternalStoragePolicyRequest.d.ts +37 -0
  23. package/dist/cjs/api/resources/externalStoragePolicies/client/requests/UpdateExternalStoragePolicyRequest.js +13 -0
  24. package/dist/cjs/api/resources/externalStoragePolicies/client/requests/index.d.ts +5 -0
  25. package/dist/cjs/api/resources/externalStoragePolicies/client/requests/index.js +7 -0
  26. package/dist/cjs/api/resources/externalStoragePolicies/exports.d.ts +2 -0
  27. package/dist/cjs/api/resources/externalStoragePolicies/exports.js +21 -0
  28. package/dist/cjs/api/resources/externalStoragePolicies/index.d.ts +2 -0
  29. package/dist/cjs/api/resources/externalStoragePolicies/index.js +18 -0
  30. package/dist/cjs/api/resources/externalStoragePolicies/types/ExternalStoragePoliciesCreateResponse.d.ts +6 -0
  31. package/dist/cjs/api/resources/externalStoragePolicies/types/ExternalStoragePoliciesCreateResponse.js +3 -0
  32. package/dist/cjs/api/resources/externalStoragePolicies/types/ExternalStoragePoliciesDeleteResponse.d.ts +4 -0
  33. package/dist/cjs/api/resources/externalStoragePolicies/types/ExternalStoragePoliciesDeleteResponse.js +3 -0
  34. package/dist/cjs/api/resources/externalStoragePolicies/types/ExternalStoragePoliciesGetResponse.d.ts +4 -0
  35. package/dist/cjs/api/resources/externalStoragePolicies/types/ExternalStoragePoliciesGetResponse.js +3 -0
  36. package/dist/cjs/api/resources/externalStoragePolicies/types/ExternalStoragePoliciesListResponse.d.ts +4 -0
  37. package/dist/cjs/api/resources/externalStoragePolicies/types/ExternalStoragePoliciesListResponse.js +3 -0
  38. package/dist/cjs/api/resources/externalStoragePolicies/types/ExternalStoragePoliciesUpdateResponse.d.ts +4 -0
  39. package/dist/cjs/api/resources/externalStoragePolicies/types/ExternalStoragePoliciesUpdateResponse.js +3 -0
  40. package/dist/cjs/api/resources/externalStoragePolicies/types/index.d.ts +5 -0
  41. package/dist/cjs/api/resources/externalStoragePolicies/types/index.js +21 -0
  42. package/dist/cjs/api/resources/index.d.ts +3 -0
  43. package/dist/cjs/api/resources/index.js +4 -1
  44. package/dist/cjs/api/resources/tools/client/Client.d.ts +65 -0
  45. package/dist/cjs/api/resources/tools/client/Client.js +65 -0
  46. package/dist/cjs/api/resources/tools/client/requests/CreateToolRequest.d.ts +100 -6
  47. package/dist/cjs/api/resources/tools/client/requests/CreateToolRequest.js +7 -0
  48. package/dist/cjs/api/resources/tools/client/requests/UpdateToolRequest.d.ts +27 -6
  49. package/dist/cjs/api/resources/tools/client/requests/UpdateToolRequest.js +8 -1
  50. package/dist/cjs/api/types/Agent.d.ts +3 -1
  51. package/dist/cjs/api/types/ConfigOptions.d.ts +4 -2
  52. package/dist/cjs/api/types/CreateAgentRequest.d.ts +4 -2
  53. package/dist/cjs/api/types/ExternalStoragePolicy.d.ts +30 -0
  54. package/dist/cjs/api/types/ExternalStoragePolicy.js +13 -0
  55. package/dist/cjs/api/types/InlineWebSocketTool.d.ts +2 -0
  56. package/dist/cjs/api/types/OutboundCallConfig.d.ts +2 -2
  57. package/dist/cjs/api/types/Tool.d.ts +26 -2
  58. package/dist/cjs/api/types/Tool.js +7 -0
  59. package/dist/cjs/api/types/ToolParameter.d.ts +5 -2
  60. package/dist/cjs/api/types/ToolParameter.js +2 -1
  61. package/dist/cjs/api/types/ToolParametersJsonSchema.d.ts +15 -0
  62. package/dist/cjs/api/types/ToolParametersJsonSchema.js +3 -0
  63. package/dist/cjs/api/types/index.d.ts +2 -0
  64. package/dist/cjs/api/types/index.js +2 -0
  65. package/dist/cjs/version.d.ts +1 -1
  66. package/dist/cjs/version.js +1 -1
  67. package/dist/esm/BaseClient.mjs +2 -2
  68. package/dist/esm/Client.d.mts +3 -0
  69. package/dist/esm/Client.mjs +5 -0
  70. package/dist/esm/api/resources/agents/client/Client.d.mts +3 -0
  71. package/dist/esm/api/resources/agents/client/Client.mjs +3 -0
  72. package/dist/esm/api/resources/agents/client/requests/AgentsAddCustomPhoneNumberRequest.d.mts +10 -7
  73. package/dist/esm/api/resources/agents/client/requests/AgentsCreateRequest.d.mts +3 -1
  74. package/dist/esm/api/resources/agents/client/requests/AgentsUpdatePhoneNumberRequest.d.mts +1 -1
  75. package/dist/esm/api/resources/agents/client/requests/UpdateAgentRequest.d.mts +4 -2
  76. package/dist/esm/api/resources/externalStoragePolicies/client/Client.d.mts +117 -0
  77. package/dist/esm/api/resources/externalStoragePolicies/client/Client.mjs +390 -0
  78. package/dist/esm/api/resources/externalStoragePolicies/client/index.d.mts +1 -0
  79. package/dist/esm/api/resources/externalStoragePolicies/client/index.mjs +1 -0
  80. package/dist/esm/api/resources/externalStoragePolicies/client/requests/CreateExternalStoragePolicyRequest.d.mts +43 -0
  81. package/dist/esm/api/resources/externalStoragePolicies/client/requests/CreateExternalStoragePolicyRequest.mjs +10 -0
  82. package/dist/esm/api/resources/externalStoragePolicies/client/requests/ExternalStoragePoliciesDeleteRequest.d.mts +10 -0
  83. package/dist/esm/api/resources/externalStoragePolicies/client/requests/ExternalStoragePoliciesDeleteRequest.mjs +2 -0
  84. package/dist/esm/api/resources/externalStoragePolicies/client/requests/ExternalStoragePoliciesGetRequest.d.mts +10 -0
  85. package/dist/esm/api/resources/externalStoragePolicies/client/requests/ExternalStoragePoliciesGetRequest.mjs +2 -0
  86. package/dist/esm/api/resources/externalStoragePolicies/client/requests/ExternalStoragePoliciesListRequest.d.mts +10 -0
  87. package/dist/esm/api/resources/externalStoragePolicies/client/requests/ExternalStoragePoliciesListRequest.mjs +2 -0
  88. package/dist/esm/api/resources/externalStoragePolicies/client/requests/UpdateExternalStoragePolicyRequest.d.mts +37 -0
  89. package/dist/esm/api/resources/externalStoragePolicies/client/requests/UpdateExternalStoragePolicyRequest.mjs +10 -0
  90. package/dist/esm/api/resources/externalStoragePolicies/client/requests/index.d.mts +5 -0
  91. package/dist/esm/api/resources/externalStoragePolicies/client/requests/index.mjs +2 -0
  92. package/dist/esm/api/resources/externalStoragePolicies/exports.d.mts +2 -0
  93. package/dist/esm/api/resources/externalStoragePolicies/exports.mjs +3 -0
  94. package/dist/esm/api/resources/externalStoragePolicies/index.d.mts +2 -0
  95. package/dist/esm/api/resources/externalStoragePolicies/index.mjs +2 -0
  96. package/dist/esm/api/resources/externalStoragePolicies/types/ExternalStoragePoliciesCreateResponse.d.mts +6 -0
  97. package/dist/esm/api/resources/externalStoragePolicies/types/ExternalStoragePoliciesCreateResponse.mjs +2 -0
  98. package/dist/esm/api/resources/externalStoragePolicies/types/ExternalStoragePoliciesDeleteResponse.d.mts +4 -0
  99. package/dist/esm/api/resources/externalStoragePolicies/types/ExternalStoragePoliciesDeleteResponse.mjs +2 -0
  100. package/dist/esm/api/resources/externalStoragePolicies/types/ExternalStoragePoliciesGetResponse.d.mts +4 -0
  101. package/dist/esm/api/resources/externalStoragePolicies/types/ExternalStoragePoliciesGetResponse.mjs +2 -0
  102. package/dist/esm/api/resources/externalStoragePolicies/types/ExternalStoragePoliciesListResponse.d.mts +4 -0
  103. package/dist/esm/api/resources/externalStoragePolicies/types/ExternalStoragePoliciesListResponse.mjs +2 -0
  104. package/dist/esm/api/resources/externalStoragePolicies/types/ExternalStoragePoliciesUpdateResponse.d.mts +4 -0
  105. package/dist/esm/api/resources/externalStoragePolicies/types/ExternalStoragePoliciesUpdateResponse.mjs +2 -0
  106. package/dist/esm/api/resources/externalStoragePolicies/types/index.d.mts +5 -0
  107. package/dist/esm/api/resources/externalStoragePolicies/types/index.mjs +5 -0
  108. package/dist/esm/api/resources/index.d.mts +3 -0
  109. package/dist/esm/api/resources/index.mjs +3 -0
  110. package/dist/esm/api/resources/tools/client/Client.d.mts +65 -0
  111. package/dist/esm/api/resources/tools/client/Client.mjs +65 -0
  112. package/dist/esm/api/resources/tools/client/requests/CreateToolRequest.d.mts +100 -6
  113. package/dist/esm/api/resources/tools/client/requests/CreateToolRequest.mjs +7 -0
  114. package/dist/esm/api/resources/tools/client/requests/UpdateToolRequest.d.mts +27 -6
  115. package/dist/esm/api/resources/tools/client/requests/UpdateToolRequest.mjs +8 -1
  116. package/dist/esm/api/types/Agent.d.mts +3 -1
  117. package/dist/esm/api/types/ConfigOptions.d.mts +4 -2
  118. package/dist/esm/api/types/CreateAgentRequest.d.mts +4 -2
  119. package/dist/esm/api/types/ExternalStoragePolicy.d.mts +30 -0
  120. package/dist/esm/api/types/ExternalStoragePolicy.mjs +10 -0
  121. package/dist/esm/api/types/InlineWebSocketTool.d.mts +2 -0
  122. package/dist/esm/api/types/OutboundCallConfig.d.mts +2 -2
  123. package/dist/esm/api/types/Tool.d.mts +26 -2
  124. package/dist/esm/api/types/Tool.mjs +7 -0
  125. package/dist/esm/api/types/ToolParameter.d.mts +5 -2
  126. package/dist/esm/api/types/ToolParameter.mjs +2 -1
  127. package/dist/esm/api/types/ToolParametersJsonSchema.d.mts +15 -0
  128. package/dist/esm/api/types/ToolParametersJsonSchema.mjs +2 -0
  129. package/dist/esm/api/types/index.d.mts +2 -0
  130. package/dist/esm/api/types/index.mjs +2 -0
  131. package/dist/esm/version.d.mts +1 -1
  132. package/dist/esm/version.mjs +1 -1
  133. package/dist/index.d.mts +240 -0
  134. package/dist/index.d.ts +240 -0
  135. package/dist/index.js +347 -0
  136. package/dist/index.mjs +310 -0
  137. package/package.json +12 -1
  138. package/reference.md +363 -0
@@ -0,0 +1,5 @@
1
+ export * from "./ExternalStoragePoliciesCreateResponse.mjs";
2
+ export * from "./ExternalStoragePoliciesDeleteResponse.mjs";
3
+ export * from "./ExternalStoragePoliciesGetResponse.mjs";
4
+ export * from "./ExternalStoragePoliciesListResponse.mjs";
5
+ export * from "./ExternalStoragePoliciesUpdateResponse.mjs";
@@ -12,6 +12,9 @@ export * as conversationItems from "./conversationItems/index.mjs";
12
12
  export * from "./conversations/client/requests/index.mjs";
13
13
  export * as conversations from "./conversations/index.mjs";
14
14
  export * from "./conversations/types/index.mjs";
15
+ export * from "./externalStoragePolicies/client/requests/index.mjs";
16
+ export * as externalStoragePolicies from "./externalStoragePolicies/index.mjs";
17
+ export * from "./externalStoragePolicies/types/index.mjs";
15
18
  export * from "./extractionSchemas/client/requests/index.mjs";
16
19
  export * as extractionSchemas from "./extractionSchemas/index.mjs";
17
20
  export * from "./extractionSchemas/types/index.mjs";
@@ -12,6 +12,9 @@ export * as conversationItems from "./conversationItems/index.mjs";
12
12
  export * from "./conversations/client/requests/index.mjs";
13
13
  export * as conversations from "./conversations/index.mjs";
14
14
  export * from "./conversations/types/index.mjs";
15
+ export * from "./externalStoragePolicies/client/requests/index.mjs";
16
+ export * as externalStoragePolicies from "./externalStoragePolicies/index.mjs";
17
+ export * from "./externalStoragePolicies/types/index.mjs";
15
18
  export * from "./extractionSchemas/client/requests/index.mjs";
16
19
  export * as extractionSchemas from "./extractionSchemas/index.mjs";
17
20
  export * from "./extractionSchemas/types/index.mjs";
@@ -90,6 +90,71 @@ export declare class ToolsClient {
90
90
  * @example
91
91
  * await client.tools.create({
92
92
  * project: "main",
93
+ * name: "create_order",
94
+ * description: "Creates an order in the fulfillment system",
95
+ * type: "custom_webhook",
96
+ * execution_mode: "sync",
97
+ * parameters: {
98
+ * type: "object",
99
+ * properties: {
100
+ * "customer": {
101
+ * "type": "object",
102
+ * "description": "The customer placing the order",
103
+ * "properties": {
104
+ * "name": {
105
+ * "type": "string",
106
+ * "description": "The customer's full name"
107
+ * },
108
+ * "tier": {
109
+ * "type": "string",
110
+ * "enum": [
111
+ * "free",
112
+ * "pro"
113
+ * ],
114
+ * "description": "The customer's subscription tier"
115
+ * }
116
+ * },
117
+ * "required": [
118
+ * "name"
119
+ * ]
120
+ * },
121
+ * "items": {
122
+ * "type": "array",
123
+ * "description": "The items being ordered",
124
+ * "items": {
125
+ * "type": "object",
126
+ * "properties": {
127
+ * "sku": {
128
+ * "type": "string",
129
+ * "description": "The item's SKU"
130
+ * },
131
+ * "quantity": {
132
+ * "type": "integer",
133
+ * "description": "How many of the item to order"
134
+ * }
135
+ * },
136
+ * "required": [
137
+ * "sku",
138
+ * "quantity"
139
+ * ]
140
+ * }
141
+ * }
142
+ * },
143
+ * required: ["customer", "items"],
144
+ * additionalProperties: false
145
+ * },
146
+ * parameter_locations: {
147
+ * "customer": "request_body",
148
+ * "items": "request_body"
149
+ * },
150
+ * endpoint_method: "POST",
151
+ * endpoint_url: "https://api.example.com/orders",
152
+ * endpoint_timeout_ms: 5000
153
+ * })
154
+ *
155
+ * @example
156
+ * await client.tools.create({
157
+ * project: "main",
93
158
  * name: "check_inventory",
94
159
  * description: "Checks product inventory levels",
95
160
  * type: "custom_websocket",
@@ -150,6 +150,71 @@ export class ToolsClient {
150
150
  * @example
151
151
  * await client.tools.create({
152
152
  * project: "main",
153
+ * name: "create_order",
154
+ * description: "Creates an order in the fulfillment system",
155
+ * type: "custom_webhook",
156
+ * execution_mode: "sync",
157
+ * parameters: {
158
+ * type: "object",
159
+ * properties: {
160
+ * "customer": {
161
+ * "type": "object",
162
+ * "description": "The customer placing the order",
163
+ * "properties": {
164
+ * "name": {
165
+ * "type": "string",
166
+ * "description": "The customer's full name"
167
+ * },
168
+ * "tier": {
169
+ * "type": "string",
170
+ * "enum": [
171
+ * "free",
172
+ * "pro"
173
+ * ],
174
+ * "description": "The customer's subscription tier"
175
+ * }
176
+ * },
177
+ * "required": [
178
+ * "name"
179
+ * ]
180
+ * },
181
+ * "items": {
182
+ * "type": "array",
183
+ * "description": "The items being ordered",
184
+ * "items": {
185
+ * "type": "object",
186
+ * "properties": {
187
+ * "sku": {
188
+ * "type": "string",
189
+ * "description": "The item's SKU"
190
+ * },
191
+ * "quantity": {
192
+ * "type": "integer",
193
+ * "description": "How many of the item to order"
194
+ * }
195
+ * },
196
+ * "required": [
197
+ * "sku",
198
+ * "quantity"
199
+ * ]
200
+ * }
201
+ * }
202
+ * },
203
+ * required: ["customer", "items"],
204
+ * additionalProperties: false
205
+ * },
206
+ * parameter_locations: {
207
+ * "customer": "request_body",
208
+ * "items": "request_body"
209
+ * },
210
+ * endpoint_method: "POST",
211
+ * endpoint_url: "https://api.example.com/orders",
212
+ * endpoint_timeout_ms: 5000
213
+ * })
214
+ *
215
+ * @example
216
+ * await client.tools.create({
217
+ * project: "main",
153
218
  * name: "check_inventory",
154
219
  * description: "Checks product inventory levels",
155
220
  * type: "custom_websocket",
@@ -55,6 +55,71 @@ import type * as Phonic from "../../../../index.mjs";
55
55
  * @example
56
56
  * {
57
57
  * project: "main",
58
+ * name: "create_order",
59
+ * description: "Creates an order in the fulfillment system",
60
+ * type: "custom_webhook",
61
+ * execution_mode: "sync",
62
+ * parameters: {
63
+ * type: "object",
64
+ * properties: {
65
+ * "customer": {
66
+ * "type": "object",
67
+ * "description": "The customer placing the order",
68
+ * "properties": {
69
+ * "name": {
70
+ * "type": "string",
71
+ * "description": "The customer's full name"
72
+ * },
73
+ * "tier": {
74
+ * "type": "string",
75
+ * "enum": [
76
+ * "free",
77
+ * "pro"
78
+ * ],
79
+ * "description": "The customer's subscription tier"
80
+ * }
81
+ * },
82
+ * "required": [
83
+ * "name"
84
+ * ]
85
+ * },
86
+ * "items": {
87
+ * "type": "array",
88
+ * "description": "The items being ordered",
89
+ * "items": {
90
+ * "type": "object",
91
+ * "properties": {
92
+ * "sku": {
93
+ * "type": "string",
94
+ * "description": "The item's SKU"
95
+ * },
96
+ * "quantity": {
97
+ * "type": "integer",
98
+ * "description": "How many of the item to order"
99
+ * }
100
+ * },
101
+ * "required": [
102
+ * "sku",
103
+ * "quantity"
104
+ * ]
105
+ * }
106
+ * }
107
+ * },
108
+ * required: ["customer", "items"],
109
+ * additionalProperties: false
110
+ * },
111
+ * parameter_locations: {
112
+ * "customer": "request_body",
113
+ * "items": "request_body"
114
+ * },
115
+ * endpoint_method: "POST",
116
+ * endpoint_url: "https://api.example.com/orders",
117
+ * endpoint_timeout_ms: 5000
118
+ * }
119
+ *
120
+ * @example
121
+ * {
122
+ * project: "main",
58
123
  * name: "check_inventory",
59
124
  * description: "Checks product inventory levels",
60
125
  * type: "custom_websocket",
@@ -111,15 +176,24 @@ export interface CreateToolRequest {
111
176
  /** Mode of operation. */
112
177
  execution_mode: CreateToolRequest.ExecutionMode;
113
178
  /**
114
- * Array of parameter definitions.
115
- * For `custom_webhook` tools with POST method, each parameter must include a `location` field.
116
- * For `custom_webhook` tools with GET method, `location` defaults to `"query_string"` if not specified.
117
- * For `custom_websocket`, `built_in_transfer_to_phone_number`, and `built_in_transfer_to_agent` tools, `location` must not be specified.
179
+ * The tool's parameters, either as a flat array of parameter definitions or as a raw JSON Schema object (use the object form for nested parameters).
180
+ * When sending an array:
181
+ * - For `custom_webhook` tools with POST method, each parameter must include a `location` field.
182
+ * - For `custom_webhook` tools with GET method, `location` defaults to `"query_string"` if not specified.
183
+ * - For `custom_websocket`, `built_in_transfer_to_phone_number`, and `built_in_transfer_to_agent` tools, `location` must not be specified.
184
+ * - `parameter_locations` must not be sent, since placement is carried inline on each parameter.
185
+ * When sending a JSON Schema object, `custom_webhook` tools supply parameter placement in `parameter_locations` instead.
186
+ * Tools that cannot have parameters (`custom_context` and the `built_in_*` types) must send an empty array or omit the field.
118
187
  */
119
- parameters?: Phonic.ToolParameter[];
188
+ parameters?: CreateToolRequest.Parameters;
189
+ /**
190
+ * Where each top-level parameter is sent in the webhook request, as a map from parameter name to location. Only for `custom_webhook` tools whose `parameters` are a raw JSON Schema object.
191
+ * Every key must name a top-level parameter. For POST webhooks, every parameter needs an entry. For GET webhooks, entries default to `"query_string"` and `"request_body"` is not allowed.
192
+ */
193
+ parameter_locations?: Record<string, CreateToolRequest.ParameterLocations.Value>;
120
194
  /** Required for webhook tools. HTTP method for the webhook endpoint. */
121
195
  endpoint_method?: CreateToolRequest.EndpointMethod;
122
- /** Required for webhook tools. */
196
+ /** Required for webhook tools. Must be a publicly routable HTTPS URL without embedded credentials. */
123
197
  endpoint_url?: string;
124
198
  /** Optional headers for webhook tools. */
125
199
  endpoint_headers?: Record<string, string>;
@@ -147,6 +221,8 @@ export interface CreateToolRequest {
147
221
  wait_for_speech_before_tool_call?: boolean;
148
222
  /** When true, forbids the agent from speaking after executing the tool. Available for custom_context, custom_webhook and custom_websocket tools. */
149
223
  forbid_speech_after_tool_call?: boolean;
224
+ /** When true, forbids the agent from calling the tool right after it has spoken. Available for custom_webhook and custom_websocket tools. */
225
+ forbid_tool_call_after_speech?: boolean;
150
226
  /** When true, allows the agent to chain and execute other tools after executing the tool. Available for custom_context, custom_webhook and custom_websocket tools. */
151
227
  allow_tool_chaining?: boolean;
152
228
  /** The agent doesn't typically wait for the response of async custom_websocket 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_websocket tools. */
@@ -173,6 +249,24 @@ export declare namespace CreateToolRequest {
173
249
  readonly Async: "async";
174
250
  };
175
251
  type ExecutionMode = (typeof ExecutionMode)[keyof typeof ExecutionMode];
252
+ /**
253
+ * The tool's parameters, either as a flat array of parameter definitions or as a raw JSON Schema object (use the object form for nested parameters).
254
+ * When sending an array:
255
+ * - For `custom_webhook` tools with POST method, each parameter must include a `location` field.
256
+ * - For `custom_webhook` tools with GET method, `location` defaults to `"query_string"` if not specified.
257
+ * - For `custom_websocket`, `built_in_transfer_to_phone_number`, and `built_in_transfer_to_agent` tools, `location` must not be specified.
258
+ * - `parameter_locations` must not be sent, since placement is carried inline on each parameter.
259
+ * When sending a JSON Schema object, `custom_webhook` tools supply parameter placement in `parameter_locations` instead.
260
+ * Tools that cannot have parameters (`custom_context` and the `built_in_*` types) must send an empty array or omit the field.
261
+ */
262
+ type Parameters = Phonic.ToolParameter[] | Phonic.ToolParametersJsonSchema;
263
+ namespace ParameterLocations {
264
+ const Value: {
265
+ readonly RequestBody: "request_body";
266
+ readonly QueryString: "query_string";
267
+ };
268
+ type Value = (typeof Value)[keyof typeof Value];
269
+ }
176
270
  /** Required for webhook tools. HTTP method for the webhook endpoint. */
177
271
  const EndpointMethod: {
178
272
  readonly Get: "GET";
@@ -17,6 +17,13 @@ export var CreateToolRequest;
17
17
  Sync: "sync",
18
18
  Async: "async",
19
19
  };
20
+ let ParameterLocations;
21
+ (function (ParameterLocations) {
22
+ ParameterLocations.Value = {
23
+ RequestBody: "request_body",
24
+ QueryString: "query_string",
25
+ };
26
+ })(ParameterLocations = CreateToolRequest.ParameterLocations || (CreateToolRequest.ParameterLocations = {}));
20
27
  /** Required for webhook tools. HTTP method for the webhook endpoint. */
21
28
  CreateToolRequest.EndpointMethod = {
22
29
  Get: "GET",
@@ -22,14 +22,20 @@ export interface UpdateToolRequest {
22
22
  /** The static context returned to the agent. Only applicable to custom_context tools. */
23
23
  context?: string;
24
24
  /**
25
- * Array of parameter definitions.
26
- * When updating `endpoint_method`, all parameters must include explicit `location` values.
27
- * For `custom_webhook` tools: `location` is required for POST, defaults to `"query_string"` for GET.
25
+ * The tool's parameters, either as a flat array of parameter definitions or as a raw JSON Schema object (use the object form for nested parameters). Replaces the tool's existing parameters, including the form they are stored in.
26
+ * For `custom_webhook` tools: when sending an array, `location` is required for POST and defaults to `"query_string"` for GET, and `parameter_locations` must not be sent; when sending a JSON Schema object, placement is supplied in `parameter_locations`.
28
27
  * For `custom_websocket`, `built_in_transfer_to_phone_number`, and `built_in_transfer_to_agent` tools: `location` must not be specified.
29
28
  */
30
- parameters?: Phonic.ToolParameter[];
31
- /** HTTP method for webhook tools. When changing this value, all parameters must include explicit `location` values. */
29
+ parameters?: UpdateToolRequest.Parameters;
30
+ /**
31
+ * Where each top-level parameter is sent in the webhook request, as a map from parameter name to location. Only for `custom_webhook` tools whose `parameters` are a raw JSON Schema object.
32
+ * Can be sent on its own to move existing parameters without resending `parameters`; entries are merged over the tool's current placement, so parameters left out keep where they were.
33
+ * Every key must name a top-level parameter. For POST webhooks, every parameter needs a placement. For GET webhooks, unplaced parameters default to `"query_string"` and `"request_body"` is not allowed.
34
+ */
35
+ parameter_locations?: Record<string, UpdateToolRequest.ParameterLocations.Value>;
36
+ /** HTTP method for webhook tools. When switching from POST to GET, a tool with request body parameters must also send new `parameters` (or `parameter_locations`) placing them in the query string. */
32
37
  endpoint_method?: UpdateToolRequest.EndpointMethod;
38
+ /** URL for webhook tools. Must be a publicly routable HTTPS URL without embedded credentials. */
33
39
  endpoint_url?: string;
34
40
  /** Headers for webhook tools. Set to null to clear existing headers. */
35
41
  endpoint_headers?: Record<string, string | null> | null;
@@ -55,6 +61,8 @@ export interface UpdateToolRequest {
55
61
  wait_for_speech_before_tool_call?: boolean;
56
62
  /** When true, forbids the agent from speaking after executing the tool. Available for custom_context, custom_webhook and custom_websocket tools. */
57
63
  forbid_speech_after_tool_call?: boolean;
64
+ /** When true, forbids the agent from calling the tool right after it has spoken. Available for custom_webhook and custom_websocket tools. */
65
+ forbid_tool_call_after_speech?: boolean;
58
66
  /** When true, allows the agent to chain and execute other tools after executing the tool. Available for custom_context, custom_webhook and custom_websocket tools. */
59
67
  allow_tool_chaining?: boolean;
60
68
  /** The agent doesn't typically wait for the response of async custom_websocket 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_websocket tools. */
@@ -67,7 +75,20 @@ export declare namespace UpdateToolRequest {
67
75
  readonly Async: "async";
68
76
  };
69
77
  type ExecutionMode = (typeof ExecutionMode)[keyof typeof ExecutionMode];
70
- /** HTTP method for webhook tools. When changing this value, all parameters must include explicit `location` values. */
78
+ /**
79
+ * The tool's parameters, either as a flat array of parameter definitions or as a raw JSON Schema object (use the object form for nested parameters). Replaces the tool's existing parameters, including the form they are stored in.
80
+ * For `custom_webhook` tools: when sending an array, `location` is required for POST and defaults to `"query_string"` for GET, and `parameter_locations` must not be sent; when sending a JSON Schema object, placement is supplied in `parameter_locations`.
81
+ * For `custom_websocket`, `built_in_transfer_to_phone_number`, and `built_in_transfer_to_agent` tools: `location` must not be specified.
82
+ */
83
+ type Parameters = Phonic.ToolParameter[] | Phonic.ToolParametersJsonSchema;
84
+ namespace ParameterLocations {
85
+ const Value: {
86
+ readonly RequestBody: "request_body";
87
+ readonly QueryString: "query_string";
88
+ };
89
+ type Value = (typeof Value)[keyof typeof Value];
90
+ }
91
+ /** HTTP method for webhook tools. When switching from POST to GET, a tool with request body parameters must also send new `parameters` (or `parameter_locations`) placing them in the query string. */
71
92
  const EndpointMethod: {
72
93
  readonly Get: "GET";
73
94
  readonly Post: "POST";
@@ -6,7 +6,14 @@ export var UpdateToolRequest;
6
6
  Sync: "sync",
7
7
  Async: "async",
8
8
  };
9
- /** HTTP method for webhook tools. When changing this value, all parameters must include explicit `location` values. */
9
+ let ParameterLocations;
10
+ (function (ParameterLocations) {
11
+ ParameterLocations.Value = {
12
+ RequestBody: "request_body",
13
+ QueryString: "query_string",
14
+ };
15
+ })(ParameterLocations = UpdateToolRequest.ParameterLocations || (UpdateToolRequest.ParameterLocations = {}));
16
+ /** HTTP method for webhook tools. When switching from POST to GET, a tool with request body parameters must also send new `parameters` (or `parameter_locations`) placing them in the query string. */
10
17
  UpdateToolRequest.EndpointMethod = {
11
18
  Get: "GET",
12
19
  Post: "POST",
@@ -64,6 +64,8 @@ export interface Agent {
64
64
  boosted_keywords: string[];
65
65
  /** Names of observability integrations enabled for the agent. Each must be one of the supported providers. */
66
66
  observability_integrations?: "braintrust"[] | undefined;
67
+ /** Name of the external storage policy that conversation artifacts are delivered to. `null` when the agent doesn't deliver artifacts to external storage. */
68
+ external_storage_policy?: (string | null) | undefined;
67
69
  /** Array of `{ word, pronunciation }` entries. Words must be unique. */
68
70
  pronunciation_dictionary: Agent.PronunciationDictionary.Item[];
69
71
  /** Minimum number of words required to interrupt the assistant. */
@@ -82,7 +84,7 @@ export interface Agent {
82
84
  vad_min_silence_duration_ms?: number | undefined;
83
85
  /** Voice activity detection threshold. */
84
86
  vad_threshold?: number | undefined;
85
- /** When `true`, PII and PHI are redacted from text transcripts (e.g. replaced with tags like `[PHONE NUMBER]`) and bleeped from audio recordings after the conversation ends. */
87
+ /** When `true`, PII and PHI are redacted from text transcripts (e.g. replaced with tags like `[PHONE]`) and bleeped from audio recordings after the conversation ends. */
86
88
  enable_redaction?: boolean | undefined;
87
89
  /** The URL-friendly slug of the agent. */
88
90
  slug?: string | undefined;
@@ -69,12 +69,14 @@ export interface ConfigOptions {
69
69
  tools?: Phonic.ToolDefinition[] | undefined;
70
70
  /** Template variables for system prompt and welcome message */
71
71
  template_variables?: Record<string, string> | undefined;
72
- /** When `true`, PII and PHI are redacted from text transcripts (e.g. replaced with tags like `[PHONE NUMBER]`) and bleeped from audio recordings after the conversation ends. */
72
+ /** When `true`, PII and PHI are redacted from text transcripts (e.g. replaced with tags like `[PHONE]`) and bleeped from audio recordings after the conversation ends. */
73
73
  enable_redaction?: boolean | undefined;
74
74
  /** Names of pre-configured MCP servers to make available to the assistant. Names must be unique. */
75
75
  mcp_servers?: string[] | undefined;
76
76
  /** Names of observability integrations to enable for the conversation. Each must be one of the supported providers. */
77
77
  observability_integrations?: "braintrust"[] | undefined;
78
+ /** Name of an external storage policy in the same project that conversation artifacts are delivered to. Requires `data_retention_policy.zero_data_retention` to be `true` and cannot be combined with `enable_redaction`. Set to `null` to disable external delivery. */
79
+ external_storage_policy?: (string | null) | undefined;
78
80
  /** Tasks the assistant should accomplish during the conversation. */
79
81
  tasks?: ConfigOptions.Tasks.Item[] | undefined;
80
82
  /** Pool of phone numbers to use as the caller ID for outbound calls. */
@@ -161,7 +163,7 @@ export declare namespace ConfigOptions {
161
163
  * When not `null`, the agent will call this endpoint to get configuration options for the conversation.
162
164
  */
163
165
  interface ConfigurationEndpoint {
164
- /** URL to call. */
166
+ /** URL to call. Must be a publicly routable HTTPS URL without embedded credentials. */
165
167
  url: string;
166
168
  /** Object of key-value pairs sent as headers when calling the endpoint. */
167
169
  headers?: Record<string, string> | undefined;
@@ -86,12 +86,14 @@ export interface CreateAgentRequest {
86
86
  vad_min_silence_duration_ms?: number | undefined;
87
87
  /** Voice activity detection threshold. */
88
88
  vad_threshold?: number | undefined;
89
- /** When `true`, PII and PHI are redacted from text transcripts (e.g. replaced with tags like `[PHONE NUMBER]`) and bleeped from audio recordings after the conversation ends. */
89
+ /** When `true`, PII and PHI are redacted from text transcripts (e.g. replaced with tags like `[PHONE]`) and bleeped from audio recordings after the conversation ends. */
90
90
  enable_redaction?: boolean | undefined;
91
91
  /** Array of MCP server IDs to make available to the agent. */
92
92
  mcp_server_ids?: string[] | undefined;
93
93
  /** Names of observability integrations to enable for the agent. Each must be one of the supported providers. */
94
94
  observability_integrations?: "braintrust"[] | undefined;
95
+ /** Name of an external storage policy in the same project that conversation artifacts are delivered to. Requires zero data retention and cannot be combined with `enable_redaction`. */
96
+ external_storage_policy?: (string | null) | undefined;
95
97
  }
96
98
  export declare namespace CreateAgentRequest {
97
99
  const PhoneNumber: {
@@ -152,7 +154,7 @@ export declare namespace CreateAgentRequest {
152
154
  * When not `null`, at the beginning of the conversation the agent will make a POST request to this endpoint to get configuration options.
153
155
  */
154
156
  interface ConfigurationEndpoint {
155
- /** URL to call */
157
+ /** URL to call. Must be a publicly routable HTTPS URL without embedded credentials. */
156
158
  url: string;
157
159
  /** Object of key-value pairs. */
158
160
  headers?: Record<string, string> | undefined;
@@ -0,0 +1,30 @@
1
+ /**
2
+ * An S3-compatible destination that conversation artifacts are delivered to.
3
+ */
4
+ export interface ExternalStoragePolicy {
5
+ /** The ID of the external storage policy. */
6
+ id: string;
7
+ /** The name of the external storage policy. Agents reference the policy by this name. */
8
+ name: string;
9
+ /** The S3-compatible endpoint URL that artifacts are uploaded to. */
10
+ endpoint_url: string;
11
+ /** The bucket that artifacts are uploaded to. */
12
+ bucket: string;
13
+ /** The region of the bucket. `null` when the endpoint doesn't require a region. */
14
+ region: string | null;
15
+ /** Prefix prepended to every object key. `null` when objects are written at the bucket root. */
16
+ key_prefix: string | null;
17
+ /** How bucket names are addressed in requests to the endpoint. */
18
+ addressing_style: ExternalStoragePolicy.AddressingStyle;
19
+ /** Number of agents currently referencing this external storage policy. */
20
+ agent_count: number;
21
+ }
22
+ export declare namespace ExternalStoragePolicy {
23
+ /** How bucket names are addressed in requests to the endpoint. */
24
+ const AddressingStyle: {
25
+ readonly Auto: "auto";
26
+ readonly Virtual: "virtual";
27
+ readonly Path: "path";
28
+ };
29
+ type AddressingStyle = (typeof AddressingStyle)[keyof typeof AddressingStyle];
30
+ }
@@ -0,0 +1,10 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export var ExternalStoragePolicy;
3
+ (function (ExternalStoragePolicy) {
4
+ /** How bucket names are addressed in requests to the endpoint. */
5
+ ExternalStoragePolicy.AddressingStyle = {
6
+ Auto: "auto",
7
+ Virtual: "virtual",
8
+ Path: "path",
9
+ };
10
+ })(ExternalStoragePolicy || (ExternalStoragePolicy = {}));
@@ -15,6 +15,8 @@ export interface InlineWebSocketTool {
15
15
  wait_for_speech_before_tool_call?: boolean | undefined;
16
16
  /** When true, prevents the assistant from speaking after executing the tool. */
17
17
  forbid_speech_after_tool_call?: boolean | undefined;
18
+ /** When true, prevents the assistant from calling the tool right after it has spoken. */
19
+ forbid_tool_call_after_speech?: boolean | undefined;
18
20
  /** When true, allows the assistant to call another tool after this tool. */
19
21
  allow_tool_chaining?: boolean | undefined;
20
22
  /** For async tools, when true, the assistant waits for the response and speaks when it arrives. */
@@ -47,7 +47,7 @@ export interface OutboundCallConfig {
47
47
  min_words_to_interrupt?: number | undefined;
48
48
  /** Array of built-in or custom tool names to use. */
49
49
  tools?: OutboundCallConfig.Tools.Item[] | undefined;
50
- /** When `true`, PII and PHI are redacted from text transcripts (e.g. replaced with tags like `[PHONE NUMBER]`) and bleeped from audio recordings after the conversation ends. */
50
+ /** When `true`, PII and PHI are redacted from text transcripts (e.g. replaced with tags like `[PHONE]`) and bleeped from audio recordings after the conversation ends. */
51
51
  enable_redaction?: boolean | undefined;
52
52
  /** The speech-to-speech model to use. */
53
53
  model?: "merritt" | undefined;
@@ -113,7 +113,7 @@ export declare namespace OutboundCallConfig {
113
113
  * When not `null`, at the beginning of the conversation the agent will make a POST request to this endpoint to get configuration options.
114
114
  */
115
115
  interface ConfigurationEndpoint {
116
- /** URL to call */
116
+ /** URL to call. Must be a publicly routable HTTPS URL without embedded credentials. */
117
117
  url: string;
118
118
  /** Object of key-value pairs. */
119
119
  headers?: Record<string, string> | undefined;
@@ -11,8 +11,17 @@ export interface Tool {
11
11
  type: Tool.Type;
12
12
  /** Mode of operation - sync waits for response, async continues without waiting. */
13
13
  execution_mode?: Tool.ExecutionMode | undefined;
14
- /** Array of parameter definitions for the tool. */
15
- parameters: Phonic.ToolParameter[];
14
+ /**
15
+ * The tool's parameters, returned in the same form they were defined in.
16
+ * Tools defined with a flat list of parameters return an array of parameter definitions (with `location` included inline for `custom_webhook` tools).
17
+ * Tools defined with a raw JSON Schema object return that object; for `custom_webhook` tools the parameter placement is then returned separately in `parameter_locations`.
18
+ */
19
+ parameters: Tool.Parameters;
20
+ /**
21
+ * Where each top-level parameter is sent in the webhook request, as a map from parameter name to location.
22
+ * Only returned for `custom_webhook` tools whose `parameters` are a raw JSON Schema object. Tools defined with a flat list of parameters carry `location` inline on each parameter instead.
23
+ */
24
+ parameter_locations?: Record<string, Tool.ParameterLocations.Value> | undefined;
16
25
  /** HTTP method for webhook tools. */
17
26
  endpoint_method?: Tool.EndpointMethod | undefined;
18
27
  /** URL for webhook tools. */
@@ -43,6 +52,8 @@ export interface Tool {
43
52
  wait_for_speech_before_tool_call?: boolean | undefined;
44
53
  /** When true, forbids the agent from speaking after executing the tool. Available for custom_context, custom_webhook and custom_websocket tools. */
45
54
  forbid_speech_after_tool_call?: boolean | undefined;
55
+ /** When true, forbids the agent from calling the tool right after it has spoken. Available for custom_webhook and custom_websocket tools. */
56
+ forbid_tool_call_after_speech?: boolean | undefined;
46
57
  /** When true, allows the agent to chain and execute other tools after executing the tool. Available for custom_context, custom_webhook and custom_websocket tools. */
47
58
  allow_tool_chaining?: boolean | undefined;
48
59
  /** The agent doesn't typically wait for the response of async custom_websocket 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_websocket tools. */
@@ -73,6 +84,19 @@ export declare namespace Tool {
73
84
  readonly Async: "async";
74
85
  };
75
86
  type ExecutionMode = (typeof ExecutionMode)[keyof typeof ExecutionMode];
87
+ /**
88
+ * The tool's parameters, returned in the same form they were defined in.
89
+ * Tools defined with a flat list of parameters return an array of parameter definitions (with `location` included inline for `custom_webhook` tools).
90
+ * Tools defined with a raw JSON Schema object return that object; for `custom_webhook` tools the parameter placement is then returned separately in `parameter_locations`.
91
+ */
92
+ type Parameters = Phonic.ToolParameter[] | Phonic.ToolParametersJsonSchema;
93
+ namespace ParameterLocations {
94
+ const Value: {
95
+ readonly RequestBody: "request_body";
96
+ readonly QueryString: "query_string";
97
+ };
98
+ type Value = (typeof Value)[keyof typeof Value];
99
+ }
76
100
  /** HTTP method for webhook tools. */
77
101
  const EndpointMethod: {
78
102
  readonly Get: "GET";
@@ -17,6 +17,13 @@ export var Tool;
17
17
  Sync: "sync",
18
18
  Async: "async",
19
19
  };
20
+ let ParameterLocations;
21
+ (function (ParameterLocations) {
22
+ ParameterLocations.Value = {
23
+ RequestBody: "request_body",
24
+ QueryString: "query_string",
25
+ };
26
+ })(ParameterLocations = Tool.ParameterLocations || (Tool.ParameterLocations = {}));
20
27
  /** HTTP method for webhook tools. */
21
28
  Tool.EndpointMethod = {
22
29
  Get: "GET",