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,21 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
+ if (k2 === undefined) k2 = k;
5
+ var desc = Object.getOwnPropertyDescriptor(m, k);
6
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
+ desc = { enumerable: true, get: function() { return m[k]; } };
8
+ }
9
+ Object.defineProperty(o, k2, desc);
10
+ }) : (function(o, m, k, k2) {
11
+ if (k2 === undefined) k2 = k;
12
+ o[k2] = m[k];
13
+ }));
14
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
16
+ };
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.ExternalStoragePoliciesClient = void 0;
19
+ var Client_js_1 = require("./client/Client.js");
20
+ Object.defineProperty(exports, "ExternalStoragePoliciesClient", { enumerable: true, get: function () { return Client_js_1.ExternalStoragePoliciesClient; } });
21
+ __exportStar(require("./client/index.js"), exports);
@@ -0,0 +1,2 @@
1
+ export * from "./client/index.js";
2
+ export * from "./types/index.js";
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./client/index.js"), exports);
18
+ __exportStar(require("./types/index.js"), exports);
@@ -0,0 +1,6 @@
1
+ export interface ExternalStoragePoliciesCreateResponse {
2
+ /** The ID of the created external storage policy. */
3
+ id: string;
4
+ /** The name of the created external storage policy. */
5
+ name: string;
6
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,4 @@
1
+ export interface ExternalStoragePoliciesDeleteResponse {
2
+ /** Whether the external storage policy was deleted successfully. */
3
+ success: boolean;
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,4 @@
1
+ import type * as Phonic from "../../../index.js";
2
+ export interface ExternalStoragePoliciesGetResponse {
3
+ external_storage_policy: Phonic.ExternalStoragePolicy;
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,4 @@
1
+ import type * as Phonic from "../../../index.js";
2
+ export interface ExternalStoragePoliciesListResponse {
3
+ external_storage_policies: Phonic.ExternalStoragePolicy[];
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,4 @@
1
+ export interface ExternalStoragePoliciesUpdateResponse {
2
+ /** Whether the external storage policy was updated successfully. */
3
+ success: boolean;
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 * from "./ExternalStoragePoliciesCreateResponse.js";
2
+ export * from "./ExternalStoragePoliciesDeleteResponse.js";
3
+ export * from "./ExternalStoragePoliciesGetResponse.js";
4
+ export * from "./ExternalStoragePoliciesListResponse.js";
5
+ export * from "./ExternalStoragePoliciesUpdateResponse.js";
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./ExternalStoragePoliciesCreateResponse.js"), exports);
18
+ __exportStar(require("./ExternalStoragePoliciesDeleteResponse.js"), exports);
19
+ __exportStar(require("./ExternalStoragePoliciesGetResponse.js"), exports);
20
+ __exportStar(require("./ExternalStoragePoliciesListResponse.js"), exports);
21
+ __exportStar(require("./ExternalStoragePoliciesUpdateResponse.js"), exports);
@@ -12,6 +12,9 @@ export * as conversationItems from "./conversationItems/index.js";
12
12
  export * from "./conversations/client/requests/index.js";
13
13
  export * as conversations from "./conversations/index.js";
14
14
  export * from "./conversations/types/index.js";
15
+ export * from "./externalStoragePolicies/client/requests/index.js";
16
+ export * as externalStoragePolicies from "./externalStoragePolicies/index.js";
17
+ export * from "./externalStoragePolicies/types/index.js";
15
18
  export * from "./extractionSchemas/client/requests/index.js";
16
19
  export * as extractionSchemas from "./extractionSchemas/index.js";
17
20
  export * from "./extractionSchemas/types/index.js";
@@ -36,7 +36,7 @@ var __importStar = (this && this.__importStar) || (function () {
36
36
  };
37
37
  })();
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.workspace = exports.voices = exports.tts = exports.tools = exports.projects = exports.extractionSchemas = exports.conversations = exports.conversationItems = exports.auth = exports.apiKeys = exports.agents = void 0;
39
+ exports.workspace = exports.voices = exports.tts = exports.tools = exports.projects = exports.extractionSchemas = exports.externalStoragePolicies = exports.conversations = exports.conversationItems = exports.auth = exports.apiKeys = exports.agents = void 0;
40
40
  __exportStar(require("./agents/client/requests/index.js"), exports);
41
41
  exports.agents = __importStar(require("./agents/index.js"));
42
42
  __exportStar(require("./agents/types/index.js"), exports);
@@ -51,6 +51,9 @@ exports.conversationItems = __importStar(require("./conversationItems/index.js")
51
51
  __exportStar(require("./conversations/client/requests/index.js"), exports);
52
52
  exports.conversations = __importStar(require("./conversations/index.js"));
53
53
  __exportStar(require("./conversations/types/index.js"), exports);
54
+ __exportStar(require("./externalStoragePolicies/client/requests/index.js"), exports);
55
+ exports.externalStoragePolicies = __importStar(require("./externalStoragePolicies/index.js"));
56
+ __exportStar(require("./externalStoragePolicies/types/index.js"), exports);
54
57
  __exportStar(require("./extractionSchemas/client/requests/index.js"), exports);
55
58
  exports.extractionSchemas = __importStar(require("./extractionSchemas/index.js"));
56
59
  __exportStar(require("./extractionSchemas/types/index.js"), exports);
@@ -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",
@@ -186,6 +186,71 @@ class ToolsClient {
186
186
  * @example
187
187
  * await client.tools.create({
188
188
  * project: "main",
189
+ * name: "create_order",
190
+ * description: "Creates an order in the fulfillment system",
191
+ * type: "custom_webhook",
192
+ * execution_mode: "sync",
193
+ * parameters: {
194
+ * type: "object",
195
+ * properties: {
196
+ * "customer": {
197
+ * "type": "object",
198
+ * "description": "The customer placing the order",
199
+ * "properties": {
200
+ * "name": {
201
+ * "type": "string",
202
+ * "description": "The customer's full name"
203
+ * },
204
+ * "tier": {
205
+ * "type": "string",
206
+ * "enum": [
207
+ * "free",
208
+ * "pro"
209
+ * ],
210
+ * "description": "The customer's subscription tier"
211
+ * }
212
+ * },
213
+ * "required": [
214
+ * "name"
215
+ * ]
216
+ * },
217
+ * "items": {
218
+ * "type": "array",
219
+ * "description": "The items being ordered",
220
+ * "items": {
221
+ * "type": "object",
222
+ * "properties": {
223
+ * "sku": {
224
+ * "type": "string",
225
+ * "description": "The item's SKU"
226
+ * },
227
+ * "quantity": {
228
+ * "type": "integer",
229
+ * "description": "How many of the item to order"
230
+ * }
231
+ * },
232
+ * "required": [
233
+ * "sku",
234
+ * "quantity"
235
+ * ]
236
+ * }
237
+ * }
238
+ * },
239
+ * required: ["customer", "items"],
240
+ * additionalProperties: false
241
+ * },
242
+ * parameter_locations: {
243
+ * "customer": "request_body",
244
+ * "items": "request_body"
245
+ * },
246
+ * endpoint_method: "POST",
247
+ * endpoint_url: "https://api.example.com/orders",
248
+ * endpoint_timeout_ms: 5000
249
+ * })
250
+ *
251
+ * @example
252
+ * await client.tools.create({
253
+ * project: "main",
189
254
  * name: "check_inventory",
190
255
  * description: "Checks product inventory levels",
191
256
  * type: "custom_websocket",
@@ -55,6 +55,71 @@ import type * as Phonic from "../../../../index.js";
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";
@@ -20,6 +20,13 @@ var CreateToolRequest;
20
20
  Sync: "sync",
21
21
  Async: "async",
22
22
  };
23
+ let ParameterLocations;
24
+ (function (ParameterLocations) {
25
+ ParameterLocations.Value = {
26
+ RequestBody: "request_body",
27
+ QueryString: "query_string",
28
+ };
29
+ })(ParameterLocations = CreateToolRequest.ParameterLocations || (CreateToolRequest.ParameterLocations = {}));
23
30
  /** Required for webhook tools. HTTP method for the webhook endpoint. */
24
31
  CreateToolRequest.EndpointMethod = {
25
32
  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";
@@ -9,7 +9,14 @@ var UpdateToolRequest;
9
9
  Sync: "sync",
10
10
  Async: "async",
11
11
  };
12
- /** HTTP method for webhook tools. When changing this value, all parameters must include explicit `location` values. */
12
+ let ParameterLocations;
13
+ (function (ParameterLocations) {
14
+ ParameterLocations.Value = {
15
+ RequestBody: "request_body",
16
+ QueryString: "query_string",
17
+ };
18
+ })(ParameterLocations = UpdateToolRequest.ParameterLocations || (UpdateToolRequest.ParameterLocations = {}));
19
+ /** 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. */
13
20
  UpdateToolRequest.EndpointMethod = {
14
21
  Get: "GET",
15
22
  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;