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