@fonoster/common 0.27.0 → 0.30.0

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 (176) hide show
  1. package/dist/assistants/index.d.ts +2 -6
  2. package/dist/assistants/index.js +2 -6
  3. package/dist/assistants/sessionAssistantSchema.d.ts +741 -0
  4. package/dist/assistants/sessionAssistantSchema.js +112 -0
  5. package/dist/assistants/testCasesSchema.d.ts +4 -4
  6. package/dist/{voice/Dial.d.ts → calls/index.d.ts} +16 -13
  7. package/dist/calls/index.js +44 -0
  8. package/dist/cellsecrets/index.d.ts +91 -0
  9. package/dist/cellsecrets/index.js +299 -0
  10. package/dist/config/cli/check.d.ts +6 -0
  11. package/dist/config/cli/check.js +202 -0
  12. package/dist/config/cli/envFile.d.ts +23 -0
  13. package/dist/config/cli/envFile.js +81 -0
  14. package/dist/config/cli/exposure.d.ts +10 -0
  15. package/dist/config/cli/exposure.js +93 -0
  16. package/dist/config/cli/index.d.ts +2 -0
  17. package/dist/{identity/tokenHasAccessKeyId.js → config/cli/index.js} +7 -8
  18. package/dist/config/cli/info.d.ts +6 -0
  19. package/dist/config/cli/info.js +62 -0
  20. package/dist/config/cli/init.d.ts +9 -0
  21. package/dist/config/cli/init.js +152 -0
  22. package/dist/config/cli/main.d.ts +11 -0
  23. package/dist/config/cli/main.js +155 -0
  24. package/dist/config/cli/render.d.ts +44 -0
  25. package/dist/config/cli/render.js +129 -0
  26. package/dist/config/cli/secrets.d.ts +21 -0
  27. package/dist/config/cli/secrets.js +117 -0
  28. package/dist/{utils/findIntegrationsCredentials.d.ts → config/cli/types.d.ts} +6 -5
  29. package/dist/config/cli/types.js +7 -0
  30. package/dist/config/configHints.d.ts +39 -0
  31. package/dist/config/configHints.js +61 -0
  32. package/dist/{voice → config}/index.d.ts +12 -13
  33. package/dist/config/index.js +46 -0
  34. package/dist/config/integrationsSchema.d.ts +32 -0
  35. package/dist/config/integrationsSchema.js +56 -0
  36. package/dist/config/interpolateEnv.d.ts +34 -0
  37. package/dist/config/interpolateEnv.js +70 -0
  38. package/dist/config/loadServiceConfig.d.ts +33 -0
  39. package/dist/config/loadServiceConfig.js +121 -0
  40. package/dist/config/logsSchema.d.ts +76 -0
  41. package/dist/config/logsSchema.js +49 -0
  42. package/dist/config/natsConnection.d.ts +53 -0
  43. package/dist/config/natsConnection.js +58 -0
  44. package/dist/config/parseConfigFile.d.ts +7 -0
  45. package/dist/config/parseConfigFile.js +60 -0
  46. package/dist/config/resolveConfigFile.d.ts +17 -0
  47. package/dist/config/resolveConfigFile.js +54 -0
  48. package/dist/config/resolveSecretRefs.d.ts +35 -0
  49. package/dist/config/resolveSecretRefs.js +129 -0
  50. package/dist/{assistants/audioFiltersSchema.d.ts → config/strictDeep.d.ts} +9 -12
  51. package/dist/config/strictDeep.js +58 -0
  52. package/dist/config/telemetrySchema.d.ts +39 -0
  53. package/dist/config/telemetrySchema.js +44 -0
  54. package/dist/config/toJsonSchema.d.ts +30 -0
  55. package/dist/config/toJsonSchema.js +161 -0
  56. package/dist/constants.d.ts +1 -4
  57. package/dist/constants.js +4 -5
  58. package/dist/envs.d.ts +2 -1
  59. package/dist/envs.js +13 -11
  60. package/dist/identity/createAuthInterceptor.d.ts +9 -2
  61. package/dist/identity/createAuthInterceptor.js +36 -30
  62. package/dist/identity/hasAccess.d.ts +9 -3
  63. package/dist/identity/hasAccess.js +32 -8
  64. package/dist/identity/index.d.ts +1 -0
  65. package/dist/identity/index.js +1 -0
  66. package/dist/identity/isValidToken.d.ts +12 -2
  67. package/dist/identity/isValidToken.js +25 -9
  68. package/dist/identity/roles.js +22 -6
  69. package/dist/identity/types.d.ts +6 -1
  70. package/dist/identity/types.js +1 -0
  71. package/dist/{assistants/LanguageModelProvider.js → identity/verifyAccessToken.d.ts} +10 -11
  72. package/dist/identity/verifyAccessToken.js +44 -0
  73. package/dist/index.d.ts +11 -1
  74. package/dist/index.js +14 -2
  75. package/dist/net/assertPublicDestination.d.ts +52 -0
  76. package/dist/net/assertPublicDestination.js +342 -0
  77. package/dist/{voice/PlayDtmf.d.ts → net/index.d.ts} +1 -5
  78. package/dist/{voice → net}/index.js +1 -13
  79. package/dist/notifications/createSendEmail.js +3 -1
  80. package/dist/protos/applications.proto +124 -3
  81. package/dist/protos/authz.proto +23 -4
  82. package/dist/protos/capabilities.proto +94 -0
  83. package/dist/protos/identity.proto +26 -1
  84. package/dist/protos/providers.proto +135 -0
  85. package/dist/protos/webhooks.proto +140 -0
  86. package/dist/{voice/StopSay.d.ts → regions/hub/index.d.ts} +1 -6
  87. package/dist/regions/hub/index.js +35 -0
  88. package/dist/regions/hub/natsJwt.d.ts +63 -0
  89. package/dist/regions/hub/natsJwt.js +195 -0
  90. package/dist/registry/Registry.d.ts +79 -0
  91. package/dist/registry/Registry.js +418 -0
  92. package/dist/registry/cli.d.ts +20 -0
  93. package/dist/registry/cli.js +424 -0
  94. package/dist/{assistants/audioFiltersSchema.js → registry/features.d.ts} +13 -14
  95. package/dist/registry/features.js +36 -0
  96. package/dist/{assistants/LanguageModelProvider.d.ts → registry/index.d.ts} +6 -8
  97. package/dist/registry/index.js +40 -0
  98. package/dist/registry/prisma.d.ts +67 -0
  99. package/dist/registry/prisma.js +391 -0
  100. package/dist/registry/stores.d.ts +21 -0
  101. package/dist/{assistants/eventsHookSchema.js → registry/stores.js} +55 -18
  102. package/dist/registry/types.d.ts +98 -0
  103. package/dist/{voice/Say.d.ts → registry/types.js} +4 -10
  104. package/dist/registry/workspaceKeys.d.ts +41 -0
  105. package/dist/registry/workspaceKeys.js +64 -0
  106. package/dist/session/index.d.ts +19 -0
  107. package/dist/session/index.js +35 -0
  108. package/dist/session/schema.d.ts +1951 -0
  109. package/dist/session/schema.js +397 -0
  110. package/dist/sessions/index.d.ts +93 -0
  111. package/dist/sessions/index.js +194 -0
  112. package/dist/telemetry.d.ts +76 -0
  113. package/dist/telemetry.js +360 -0
  114. package/dist/types.d.ts +3 -5
  115. package/dist/utils/{findIntegrationsCredentials.js → WriteBehind.d.ts} +13 -10
  116. package/dist/utils/WriteBehind.js +64 -0
  117. package/dist/utils/index.d.ts +1 -1
  118. package/dist/utils/index.js +1 -1
  119. package/dist/{voice/Play.d.ts → utils/logUnhandledRejections.d.ts} +8 -12
  120. package/dist/utils/logUnhandledRejections.js +37 -0
  121. package/dist/validators/calls.d.ts +2 -2
  122. package/dist/validators/calls.js +5 -2
  123. package/dist/validators/identity.d.ts +37 -8
  124. package/dist/validators/identity.js +22 -3
  125. package/dist/validators/index.d.ts +1 -0
  126. package/dist/validators/index.js +1 -0
  127. package/dist/validators/sip.d.ts +40 -0
  128. package/dist/validators/sip.js +99 -0
  129. package/dist/validators/sipnet/credentials.d.ts +2 -2
  130. package/dist/validators/sipnet/domains.js +7 -7
  131. package/dist/validators/sipnet/trunks.d.ts +14 -14
  132. package/dist/validators/sipnet/trunks.js +4 -2
  133. package/dist/webhooks/Dispatcher.d.ts +87 -0
  134. package/dist/webhooks/Dispatcher.js +225 -0
  135. package/dist/webhooks/bus.d.ts +49 -0
  136. package/dist/webhooks/bus.js +170 -0
  137. package/dist/webhooks/events.d.ts +66 -0
  138. package/dist/webhooks/events.js +62 -0
  139. package/dist/webhooks/index.d.ts +23 -0
  140. package/dist/webhooks/index.js +39 -0
  141. package/dist/webhooks/prisma.d.ts +55 -0
  142. package/dist/webhooks/prisma.js +242 -0
  143. package/dist/webhooks/signing.d.ts +8 -0
  144. package/dist/webhooks/signing.js +53 -0
  145. package/package.json +25 -12
  146. package/schema/session.v1.json +791 -0
  147. package/dist/assistants/assistantSchema.d.ts +0 -739
  148. package/dist/assistants/assistantSchema.js +0 -37
  149. package/dist/assistants/conversationSettingsSchema.d.ts +0 -122
  150. package/dist/assistants/conversationSettingsSchema.js +0 -133
  151. package/dist/assistants/eventsHookSchema.d.ts +0 -38
  152. package/dist/assistants/languageModelConfigSchema.d.ts +0 -206
  153. package/dist/assistants/languageModelConfigSchema.js +0 -91
  154. package/dist/identity/tokenHasAccessKeyId.d.ts +0 -2
  155. package/dist/protos/voice.proto +0 -557
  156. package/dist/voice/Dial.js +0 -20
  157. package/dist/voice/Gather.d.ts +0 -37
  158. package/dist/voice/Gather.js +0 -9
  159. package/dist/voice/Mute.d.ts +0 -31
  160. package/dist/voice/Mute.js +0 -9
  161. package/dist/voice/Play.js +0 -2
  162. package/dist/voice/PlayDtmf.js +0 -2
  163. package/dist/voice/PlaybackControl.d.ts +0 -31
  164. package/dist/voice/PlaybackControl.js +0 -11
  165. package/dist/voice/Record.d.ts +0 -36
  166. package/dist/voice/Record.js +0 -7
  167. package/dist/voice/Say.js +0 -2
  168. package/dist/voice/StopSay.js +0 -2
  169. package/dist/voice/Stream.d.ts +0 -53
  170. package/dist/voice/Stream.js +0 -19
  171. package/dist/voice/StreamGather.d.ts +0 -34
  172. package/dist/voice/StreamGather.js +0 -9
  173. package/dist/voice/Verb.d.ts +0 -27
  174. package/dist/voice/Verb.js +0 -2
  175. package/dist/voice/voice.d.ts +0 -171
  176. package/dist/voice/voice.js +0 -65
@@ -0,0 +1,741 @@
1
+ /**
2
+ * Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
3
+ * http://github.com/fonoster/fonoster
4
+ *
5
+ * This file is part of Fonoster
6
+ *
7
+ * Licensed under the MIT License (the "License");
8
+ * you may not use this file except in compliance with
9
+ * the License. You may obtain a copy of the License at
10
+ *
11
+ * https://opensource.org/licenses/MIT
12
+ *
13
+ * Unless required by applicable law or agreed to in writing, software
14
+ * distributed under the License is distributed on an "AS IS" BASIS,
15
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ * See the License for the specific language governing permissions and
17
+ * limitations under the License.
18
+ */
19
+ import { z } from "zod";
20
+ export declare const sessionLanguageModelSchema: z.ZodObject<{
21
+ /** A catalog id such as "openai/gpt-4o-mini". */
22
+ model: z.ZodString;
23
+ temperature: z.ZodDefault<z.ZodNumber>;
24
+ maxTokens: z.ZodDefault<z.ZodNumber>;
25
+ tools: z.ZodDefault<z.ZodArray<z.ZodObject<{
26
+ name: z.ZodString;
27
+ description: z.ZodString;
28
+ parameters: z.ZodObject<{
29
+ type: z.ZodEnum<["object", "array"]>;
30
+ properties: z.ZodRecord<z.ZodString, z.ZodEffects<z.ZodObject<{
31
+ type: z.ZodString;
32
+ format: z.ZodOptional<z.ZodEnum<["enum", "date-time"]>>;
33
+ pattern: z.ZodOptional<z.ZodString>;
34
+ }, "strip", z.ZodTypeAny, {
35
+ type?: string;
36
+ format?: "enum" | "date-time";
37
+ pattern?: string;
38
+ }, {
39
+ type?: string;
40
+ format?: "enum" | "date-time";
41
+ pattern?: string;
42
+ }>, {
43
+ type?: string;
44
+ format?: "enum" | "date-time";
45
+ pattern?: string;
46
+ }, {
47
+ type?: string;
48
+ format?: "enum" | "date-time";
49
+ pattern?: string;
50
+ }>>;
51
+ required: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
52
+ }, "strip", z.ZodTypeAny, {
53
+ type?: "object" | "array";
54
+ properties?: Record<string, {
55
+ type?: string;
56
+ format?: "enum" | "date-time";
57
+ pattern?: string;
58
+ }>;
59
+ required?: string[];
60
+ }, {
61
+ type?: "object" | "array";
62
+ properties?: Record<string, {
63
+ type?: string;
64
+ format?: "enum" | "date-time";
65
+ pattern?: string;
66
+ }>;
67
+ required?: string[];
68
+ }>;
69
+ requestStartMessage: z.ZodOptional<z.ZodString>;
70
+ operation: z.ZodObject<{
71
+ method: z.ZodDefault<z.ZodNativeEnum<typeof import("..").AllowedHttpMethod>>;
72
+ url: z.ZodString;
73
+ waitForResponse: z.ZodDefault<z.ZodBoolean>;
74
+ headers: z.ZodOptional<z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodString>, Record<string, string>, Record<string, string>>>;
75
+ }, "strip", z.ZodTypeAny, {
76
+ url?: string;
77
+ method?: import("..").AllowedHttpMethod;
78
+ headers?: Record<string, string>;
79
+ waitForResponse?: boolean;
80
+ }, {
81
+ url?: string;
82
+ method?: import("..").AllowedHttpMethod;
83
+ headers?: Record<string, string>;
84
+ waitForResponse?: boolean;
85
+ }>;
86
+ }, "strip", z.ZodTypeAny, {
87
+ name?: string;
88
+ description?: string;
89
+ parameters?: {
90
+ type?: "object" | "array";
91
+ properties?: Record<string, {
92
+ type?: string;
93
+ format?: "enum" | "date-time";
94
+ pattern?: string;
95
+ }>;
96
+ required?: string[];
97
+ };
98
+ requestStartMessage?: string;
99
+ operation?: {
100
+ url?: string;
101
+ method?: import("..").AllowedHttpMethod;
102
+ headers?: Record<string, string>;
103
+ waitForResponse?: boolean;
104
+ };
105
+ }, {
106
+ name?: string;
107
+ description?: string;
108
+ parameters?: {
109
+ type?: "object" | "array";
110
+ properties?: Record<string, {
111
+ type?: string;
112
+ format?: "enum" | "date-time";
113
+ pattern?: string;
114
+ }>;
115
+ required?: string[];
116
+ };
117
+ requestStartMessage?: string;
118
+ operation?: {
119
+ url?: string;
120
+ method?: import("..").AllowedHttpMethod;
121
+ headers?: Record<string, string>;
122
+ waitForResponse?: boolean;
123
+ };
124
+ }>, "many">>;
125
+ /** Documents for the knowledge port (same shape as before; wired by the operator). */
126
+ knowledgeBase: z.ZodDefault<z.ZodArray<z.ZodObject<{
127
+ type: z.ZodEnum<["s3"]>;
128
+ title: z.ZodString;
129
+ document: z.ZodString;
130
+ }, "strip", z.ZodTypeAny, {
131
+ type?: "s3";
132
+ title?: string;
133
+ document?: string;
134
+ }, {
135
+ type?: "s3";
136
+ title?: string;
137
+ document?: string;
138
+ }>, "many">>;
139
+ provider: z.ZodEffects<z.ZodOptional<z.ZodAny>, any, any>;
140
+ apiKey: z.ZodEffects<z.ZodOptional<z.ZodAny>, any, any>;
141
+ baseUrl: z.ZodEffects<z.ZodOptional<z.ZodAny>, any, any>;
142
+ }, "strict", z.ZodTypeAny, {
143
+ model?: string;
144
+ temperature?: number;
145
+ maxTokens?: number;
146
+ tools?: {
147
+ name?: string;
148
+ description?: string;
149
+ parameters?: {
150
+ type?: "object" | "array";
151
+ properties?: Record<string, {
152
+ type?: string;
153
+ format?: "enum" | "date-time";
154
+ pattern?: string;
155
+ }>;
156
+ required?: string[];
157
+ };
158
+ requestStartMessage?: string;
159
+ operation?: {
160
+ url?: string;
161
+ method?: import("..").AllowedHttpMethod;
162
+ headers?: Record<string, string>;
163
+ waitForResponse?: boolean;
164
+ };
165
+ }[];
166
+ knowledgeBase?: {
167
+ type?: "s3";
168
+ title?: string;
169
+ document?: string;
170
+ }[];
171
+ provider?: any;
172
+ apiKey?: any;
173
+ baseUrl?: any;
174
+ }, {
175
+ model?: string;
176
+ temperature?: number;
177
+ maxTokens?: number;
178
+ tools?: {
179
+ name?: string;
180
+ description?: string;
181
+ parameters?: {
182
+ type?: "object" | "array";
183
+ properties?: Record<string, {
184
+ type?: string;
185
+ format?: "enum" | "date-time";
186
+ pattern?: string;
187
+ }>;
188
+ required?: string[];
189
+ };
190
+ requestStartMessage?: string;
191
+ operation?: {
192
+ url?: string;
193
+ method?: import("..").AllowedHttpMethod;
194
+ headers?: Record<string, string>;
195
+ waitForResponse?: boolean;
196
+ };
197
+ }[];
198
+ knowledgeBase?: {
199
+ type?: "s3";
200
+ title?: string;
201
+ document?: string;
202
+ }[];
203
+ provider?: any;
204
+ apiKey?: any;
205
+ baseUrl?: any;
206
+ }>;
207
+ export declare const sessionConversationSettingsSchema: z.ZodObject<{
208
+ firstMessage: z.ZodOptional<z.ZodString>;
209
+ systemPrompt: z.ZodString;
210
+ goodbyeMessage: z.ZodString;
211
+ systemErrorMessage: z.ZodString;
212
+ initialDtmf: z.ZodOptional<z.ZodString>;
213
+ maxSessionDuration: z.ZodDefault<z.ZodNumber>;
214
+ transferOptions: z.ZodOptional<z.ZodObject<{
215
+ phoneNumber: z.ZodString;
216
+ message: z.ZodString;
217
+ }, "strip", z.ZodTypeAny, {
218
+ message?: string;
219
+ phoneNumber?: string;
220
+ }, {
221
+ message?: string;
222
+ phoneNumber?: string;
223
+ }>>;
224
+ idleOptions: z.ZodOptional<z.ZodObject<{
225
+ message: z.ZodString;
226
+ timeout: z.ZodDefault<z.ZodNumber>;
227
+ maxTimeoutCount: z.ZodDefault<z.ZodNumber>;
228
+ }, "strip", z.ZodTypeAny, {
229
+ message?: string;
230
+ timeout?: number;
231
+ maxTimeoutCount?: number;
232
+ }, {
233
+ message?: string;
234
+ timeout?: number;
235
+ maxTimeoutCount?: number;
236
+ }>>;
237
+ allowUserBargeIn: z.ZodDefault<z.ZodBoolean>;
238
+ /**
239
+ * The turn-taking patience knob (TT-B5): sent to the gateway with listen.update so its Pacing
240
+ * policy waits less (low) or more (high) before turn.ended. Autopilot prepares a reply on
241
+ * turn.likely_ended at low and normal, and only on turn.ended at high.
242
+ */
243
+ patience: z.ZodDefault<z.ZodEnum<["low", "normal", "high"]>>;
244
+ /** Words to bias speech recognition toward (names, brands), sent with listen.update. */
245
+ hints: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
246
+ /** Played with play() while thinking; the reply preempts it (A9). */
247
+ filler: z.ZodOptional<z.ZodObject<{
248
+ url: z.ZodString;
249
+ }, "strip", z.ZodTypeAny, {
250
+ url?: string;
251
+ }, {
252
+ url?: string;
253
+ }>>;
254
+ /** Catalog ids overriding the app's speech defaults on every speak. */
255
+ voice: z.ZodOptional<z.ZodString>;
256
+ language: z.ZodOptional<z.ZodString>;
257
+ vad: z.ZodEffects<z.ZodOptional<z.ZodAny>, any, any>;
258
+ maxSpeechWaitTimeout: z.ZodEffects<z.ZodOptional<z.ZodAny>, any, any>;
259
+ }, "strict", z.ZodTypeAny, {
260
+ firstMessage?: string;
261
+ systemPrompt?: string;
262
+ goodbyeMessage?: string;
263
+ systemErrorMessage?: string;
264
+ initialDtmf?: string;
265
+ maxSessionDuration?: number;
266
+ transferOptions?: {
267
+ message?: string;
268
+ phoneNumber?: string;
269
+ };
270
+ idleOptions?: {
271
+ message?: string;
272
+ timeout?: number;
273
+ maxTimeoutCount?: number;
274
+ };
275
+ allowUserBargeIn?: boolean;
276
+ patience?: "low" | "normal" | "high";
277
+ hints?: string[];
278
+ filler?: {
279
+ url?: string;
280
+ };
281
+ voice?: string;
282
+ language?: string;
283
+ vad?: any;
284
+ maxSpeechWaitTimeout?: any;
285
+ }, {
286
+ firstMessage?: string;
287
+ systemPrompt?: string;
288
+ goodbyeMessage?: string;
289
+ systemErrorMessage?: string;
290
+ initialDtmf?: string;
291
+ maxSessionDuration?: number;
292
+ transferOptions?: {
293
+ message?: string;
294
+ phoneNumber?: string;
295
+ };
296
+ idleOptions?: {
297
+ message?: string;
298
+ timeout?: number;
299
+ maxTimeoutCount?: number;
300
+ };
301
+ allowUserBargeIn?: boolean;
302
+ patience?: "low" | "normal" | "high";
303
+ hints?: string[];
304
+ filler?: {
305
+ url?: string;
306
+ };
307
+ voice?: string;
308
+ language?: string;
309
+ vad?: any;
310
+ maxSpeechWaitTimeout?: any;
311
+ }>;
312
+ export declare const sessionAssistantSchema: z.ZodObject<{
313
+ conversationSettings: z.ZodObject<{
314
+ firstMessage: z.ZodOptional<z.ZodString>;
315
+ systemPrompt: z.ZodString;
316
+ goodbyeMessage: z.ZodString;
317
+ systemErrorMessage: z.ZodString;
318
+ initialDtmf: z.ZodOptional<z.ZodString>;
319
+ maxSessionDuration: z.ZodDefault<z.ZodNumber>;
320
+ transferOptions: z.ZodOptional<z.ZodObject<{
321
+ phoneNumber: z.ZodString;
322
+ message: z.ZodString;
323
+ }, "strip", z.ZodTypeAny, {
324
+ message?: string;
325
+ phoneNumber?: string;
326
+ }, {
327
+ message?: string;
328
+ phoneNumber?: string;
329
+ }>>;
330
+ idleOptions: z.ZodOptional<z.ZodObject<{
331
+ message: z.ZodString;
332
+ timeout: z.ZodDefault<z.ZodNumber>;
333
+ maxTimeoutCount: z.ZodDefault<z.ZodNumber>;
334
+ }, "strip", z.ZodTypeAny, {
335
+ message?: string;
336
+ timeout?: number;
337
+ maxTimeoutCount?: number;
338
+ }, {
339
+ message?: string;
340
+ timeout?: number;
341
+ maxTimeoutCount?: number;
342
+ }>>;
343
+ allowUserBargeIn: z.ZodDefault<z.ZodBoolean>;
344
+ /**
345
+ * The turn-taking patience knob (TT-B5): sent to the gateway with listen.update so its Pacing
346
+ * policy waits less (low) or more (high) before turn.ended. Autopilot prepares a reply on
347
+ * turn.likely_ended at low and normal, and only on turn.ended at high.
348
+ */
349
+ patience: z.ZodDefault<z.ZodEnum<["low", "normal", "high"]>>;
350
+ /** Words to bias speech recognition toward (names, brands), sent with listen.update. */
351
+ hints: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
352
+ /** Played with play() while thinking; the reply preempts it (A9). */
353
+ filler: z.ZodOptional<z.ZodObject<{
354
+ url: z.ZodString;
355
+ }, "strip", z.ZodTypeAny, {
356
+ url?: string;
357
+ }, {
358
+ url?: string;
359
+ }>>;
360
+ /** Catalog ids overriding the app's speech defaults on every speak. */
361
+ voice: z.ZodOptional<z.ZodString>;
362
+ language: z.ZodOptional<z.ZodString>;
363
+ vad: z.ZodEffects<z.ZodOptional<z.ZodAny>, any, any>;
364
+ maxSpeechWaitTimeout: z.ZodEffects<z.ZodOptional<z.ZodAny>, any, any>;
365
+ }, "strict", z.ZodTypeAny, {
366
+ firstMessage?: string;
367
+ systemPrompt?: string;
368
+ goodbyeMessage?: string;
369
+ systemErrorMessage?: string;
370
+ initialDtmf?: string;
371
+ maxSessionDuration?: number;
372
+ transferOptions?: {
373
+ message?: string;
374
+ phoneNumber?: string;
375
+ };
376
+ idleOptions?: {
377
+ message?: string;
378
+ timeout?: number;
379
+ maxTimeoutCount?: number;
380
+ };
381
+ allowUserBargeIn?: boolean;
382
+ patience?: "low" | "normal" | "high";
383
+ hints?: string[];
384
+ filler?: {
385
+ url?: string;
386
+ };
387
+ voice?: string;
388
+ language?: string;
389
+ vad?: any;
390
+ maxSpeechWaitTimeout?: any;
391
+ }, {
392
+ firstMessage?: string;
393
+ systemPrompt?: string;
394
+ goodbyeMessage?: string;
395
+ systemErrorMessage?: string;
396
+ initialDtmf?: string;
397
+ maxSessionDuration?: number;
398
+ transferOptions?: {
399
+ message?: string;
400
+ phoneNumber?: string;
401
+ };
402
+ idleOptions?: {
403
+ message?: string;
404
+ timeout?: number;
405
+ maxTimeoutCount?: number;
406
+ };
407
+ allowUserBargeIn?: boolean;
408
+ patience?: "low" | "normal" | "high";
409
+ hints?: string[];
410
+ filler?: {
411
+ url?: string;
412
+ };
413
+ voice?: string;
414
+ language?: string;
415
+ vad?: any;
416
+ maxSpeechWaitTimeout?: any;
417
+ }>;
418
+ languageModel: z.ZodObject<{
419
+ /** A catalog id such as "openai/gpt-4o-mini". */
420
+ model: z.ZodString;
421
+ temperature: z.ZodDefault<z.ZodNumber>;
422
+ maxTokens: z.ZodDefault<z.ZodNumber>;
423
+ tools: z.ZodDefault<z.ZodArray<z.ZodObject<{
424
+ name: z.ZodString;
425
+ description: z.ZodString;
426
+ parameters: z.ZodObject<{
427
+ type: z.ZodEnum<["object", "array"]>;
428
+ properties: z.ZodRecord<z.ZodString, z.ZodEffects<z.ZodObject<{
429
+ type: z.ZodString;
430
+ format: z.ZodOptional<z.ZodEnum<["enum", "date-time"]>>;
431
+ pattern: z.ZodOptional<z.ZodString>;
432
+ }, "strip", z.ZodTypeAny, {
433
+ type?: string;
434
+ format?: "enum" | "date-time";
435
+ pattern?: string;
436
+ }, {
437
+ type?: string;
438
+ format?: "enum" | "date-time";
439
+ pattern?: string;
440
+ }>, {
441
+ type?: string;
442
+ format?: "enum" | "date-time";
443
+ pattern?: string;
444
+ }, {
445
+ type?: string;
446
+ format?: "enum" | "date-time";
447
+ pattern?: string;
448
+ }>>;
449
+ required: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
450
+ }, "strip", z.ZodTypeAny, {
451
+ type?: "object" | "array";
452
+ properties?: Record<string, {
453
+ type?: string;
454
+ format?: "enum" | "date-time";
455
+ pattern?: string;
456
+ }>;
457
+ required?: string[];
458
+ }, {
459
+ type?: "object" | "array";
460
+ properties?: Record<string, {
461
+ type?: string;
462
+ format?: "enum" | "date-time";
463
+ pattern?: string;
464
+ }>;
465
+ required?: string[];
466
+ }>;
467
+ requestStartMessage: z.ZodOptional<z.ZodString>;
468
+ operation: z.ZodObject<{
469
+ method: z.ZodDefault<z.ZodNativeEnum<typeof import("..").AllowedHttpMethod>>;
470
+ url: z.ZodString;
471
+ waitForResponse: z.ZodDefault<z.ZodBoolean>;
472
+ headers: z.ZodOptional<z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodString>, Record<string, string>, Record<string, string>>>;
473
+ }, "strip", z.ZodTypeAny, {
474
+ url?: string;
475
+ method?: import("..").AllowedHttpMethod;
476
+ headers?: Record<string, string>;
477
+ waitForResponse?: boolean;
478
+ }, {
479
+ url?: string;
480
+ method?: import("..").AllowedHttpMethod;
481
+ headers?: Record<string, string>;
482
+ waitForResponse?: boolean;
483
+ }>;
484
+ }, "strip", z.ZodTypeAny, {
485
+ name?: string;
486
+ description?: string;
487
+ parameters?: {
488
+ type?: "object" | "array";
489
+ properties?: Record<string, {
490
+ type?: string;
491
+ format?: "enum" | "date-time";
492
+ pattern?: string;
493
+ }>;
494
+ required?: string[];
495
+ };
496
+ requestStartMessage?: string;
497
+ operation?: {
498
+ url?: string;
499
+ method?: import("..").AllowedHttpMethod;
500
+ headers?: Record<string, string>;
501
+ waitForResponse?: boolean;
502
+ };
503
+ }, {
504
+ name?: string;
505
+ description?: string;
506
+ parameters?: {
507
+ type?: "object" | "array";
508
+ properties?: Record<string, {
509
+ type?: string;
510
+ format?: "enum" | "date-time";
511
+ pattern?: string;
512
+ }>;
513
+ required?: string[];
514
+ };
515
+ requestStartMessage?: string;
516
+ operation?: {
517
+ url?: string;
518
+ method?: import("..").AllowedHttpMethod;
519
+ headers?: Record<string, string>;
520
+ waitForResponse?: boolean;
521
+ };
522
+ }>, "many">>;
523
+ /** Documents for the knowledge port (same shape as before; wired by the operator). */
524
+ knowledgeBase: z.ZodDefault<z.ZodArray<z.ZodObject<{
525
+ type: z.ZodEnum<["s3"]>;
526
+ title: z.ZodString;
527
+ document: z.ZodString;
528
+ }, "strip", z.ZodTypeAny, {
529
+ type?: "s3";
530
+ title?: string;
531
+ document?: string;
532
+ }, {
533
+ type?: "s3";
534
+ title?: string;
535
+ document?: string;
536
+ }>, "many">>;
537
+ provider: z.ZodEffects<z.ZodOptional<z.ZodAny>, any, any>;
538
+ apiKey: z.ZodEffects<z.ZodOptional<z.ZodAny>, any, any>;
539
+ baseUrl: z.ZodEffects<z.ZodOptional<z.ZodAny>, any, any>;
540
+ }, "strict", z.ZodTypeAny, {
541
+ model?: string;
542
+ temperature?: number;
543
+ maxTokens?: number;
544
+ tools?: {
545
+ name?: string;
546
+ description?: string;
547
+ parameters?: {
548
+ type?: "object" | "array";
549
+ properties?: Record<string, {
550
+ type?: string;
551
+ format?: "enum" | "date-time";
552
+ pattern?: string;
553
+ }>;
554
+ required?: string[];
555
+ };
556
+ requestStartMessage?: string;
557
+ operation?: {
558
+ url?: string;
559
+ method?: import("..").AllowedHttpMethod;
560
+ headers?: Record<string, string>;
561
+ waitForResponse?: boolean;
562
+ };
563
+ }[];
564
+ knowledgeBase?: {
565
+ type?: "s3";
566
+ title?: string;
567
+ document?: string;
568
+ }[];
569
+ provider?: any;
570
+ apiKey?: any;
571
+ baseUrl?: any;
572
+ }, {
573
+ model?: string;
574
+ temperature?: number;
575
+ maxTokens?: number;
576
+ tools?: {
577
+ name?: string;
578
+ description?: string;
579
+ parameters?: {
580
+ type?: "object" | "array";
581
+ properties?: Record<string, {
582
+ type?: string;
583
+ format?: "enum" | "date-time";
584
+ pattern?: string;
585
+ }>;
586
+ required?: string[];
587
+ };
588
+ requestStartMessage?: string;
589
+ operation?: {
590
+ url?: string;
591
+ method?: import("..").AllowedHttpMethod;
592
+ headers?: Record<string, string>;
593
+ waitForResponse?: boolean;
594
+ };
595
+ }[];
596
+ knowledgeBase?: {
597
+ type?: "s3";
598
+ title?: string;
599
+ document?: string;
600
+ }[];
601
+ provider?: any;
602
+ apiKey?: any;
603
+ baseUrl?: any;
604
+ }>;
605
+ /** Conversation eval cases, kept as they were (evaluated outside calls). */
606
+ testCases: z.ZodOptional<z.ZodAny>;
607
+ eventsHook: z.ZodEffects<z.ZodOptional<z.ZodAny>, any, any>;
608
+ audioFilters: z.ZodEffects<z.ZodOptional<z.ZodAny>, any, any>;
609
+ }, "strict", z.ZodTypeAny, {
610
+ conversationSettings?: {
611
+ firstMessage?: string;
612
+ systemPrompt?: string;
613
+ goodbyeMessage?: string;
614
+ systemErrorMessage?: string;
615
+ initialDtmf?: string;
616
+ maxSessionDuration?: number;
617
+ transferOptions?: {
618
+ message?: string;
619
+ phoneNumber?: string;
620
+ };
621
+ idleOptions?: {
622
+ message?: string;
623
+ timeout?: number;
624
+ maxTimeoutCount?: number;
625
+ };
626
+ allowUserBargeIn?: boolean;
627
+ patience?: "low" | "normal" | "high";
628
+ hints?: string[];
629
+ filler?: {
630
+ url?: string;
631
+ };
632
+ voice?: string;
633
+ language?: string;
634
+ vad?: any;
635
+ maxSpeechWaitTimeout?: any;
636
+ };
637
+ languageModel?: {
638
+ model?: string;
639
+ temperature?: number;
640
+ maxTokens?: number;
641
+ tools?: {
642
+ name?: string;
643
+ description?: string;
644
+ parameters?: {
645
+ type?: "object" | "array";
646
+ properties?: Record<string, {
647
+ type?: string;
648
+ format?: "enum" | "date-time";
649
+ pattern?: string;
650
+ }>;
651
+ required?: string[];
652
+ };
653
+ requestStartMessage?: string;
654
+ operation?: {
655
+ url?: string;
656
+ method?: import("..").AllowedHttpMethod;
657
+ headers?: Record<string, string>;
658
+ waitForResponse?: boolean;
659
+ };
660
+ }[];
661
+ knowledgeBase?: {
662
+ type?: "s3";
663
+ title?: string;
664
+ document?: string;
665
+ }[];
666
+ provider?: any;
667
+ apiKey?: any;
668
+ baseUrl?: any;
669
+ };
670
+ testCases?: any;
671
+ eventsHook?: any;
672
+ audioFilters?: any;
673
+ }, {
674
+ conversationSettings?: {
675
+ firstMessage?: string;
676
+ systemPrompt?: string;
677
+ goodbyeMessage?: string;
678
+ systemErrorMessage?: string;
679
+ initialDtmf?: string;
680
+ maxSessionDuration?: number;
681
+ transferOptions?: {
682
+ message?: string;
683
+ phoneNumber?: string;
684
+ };
685
+ idleOptions?: {
686
+ message?: string;
687
+ timeout?: number;
688
+ maxTimeoutCount?: number;
689
+ };
690
+ allowUserBargeIn?: boolean;
691
+ patience?: "low" | "normal" | "high";
692
+ hints?: string[];
693
+ filler?: {
694
+ url?: string;
695
+ };
696
+ voice?: string;
697
+ language?: string;
698
+ vad?: any;
699
+ maxSpeechWaitTimeout?: any;
700
+ };
701
+ languageModel?: {
702
+ model?: string;
703
+ temperature?: number;
704
+ maxTokens?: number;
705
+ tools?: {
706
+ name?: string;
707
+ description?: string;
708
+ parameters?: {
709
+ type?: "object" | "array";
710
+ properties?: Record<string, {
711
+ type?: string;
712
+ format?: "enum" | "date-time";
713
+ pattern?: string;
714
+ }>;
715
+ required?: string[];
716
+ };
717
+ requestStartMessage?: string;
718
+ operation?: {
719
+ url?: string;
720
+ method?: import("..").AllowedHttpMethod;
721
+ headers?: Record<string, string>;
722
+ waitForResponse?: boolean;
723
+ };
724
+ }[];
725
+ knowledgeBase?: {
726
+ type?: "s3";
727
+ title?: string;
728
+ document?: string;
729
+ }[];
730
+ provider?: any;
731
+ apiKey?: any;
732
+ baseUrl?: any;
733
+ };
734
+ testCases?: any;
735
+ eventsHook?: any;
736
+ audioFilters?: any;
737
+ }>;
738
+ export type SessionAssistant = z.infer<typeof sessionAssistantSchema>;
739
+ export type SessionConversationSettings = SessionAssistant["conversationSettings"];
740
+ export type SessionLanguageModel = SessionAssistant["languageModel"];
741
+ export type ToolDefinition = SessionLanguageModel["tools"][number];