@fonoster/apiserver 0.8.25 → 0.8.27

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 (120) hide show
  1. package/dist/applications/buildService.js +10 -10
  2. package/dist/applications/{createApplication.d.ts → createCreateApplication.d.ts} +2 -2
  3. package/dist/applications/{createApplication.js → createCreateApplication.js} +14 -7
  4. package/dist/applications/{getApplication.d.ts → createDeleteApplication.d.ts} +2 -2
  5. package/dist/applications/{deleteApplication.js → createDeleteApplication.js} +4 -4
  6. package/dist/applications/{updateApplication.d.ts → createGetApplication.d.ts} +2 -2
  7. package/dist/applications/{getApplication.js → createGetApplication.js} +4 -4
  8. package/dist/applications/createGetFnUtil.d.ts +2 -0
  9. package/dist/applications/{listApplications.d.ts → createListApplications.d.ts} +2 -2
  10. package/dist/applications/{listApplications.js → createListApplications.js} +5 -6
  11. package/dist/applications/{deleteApplication.d.ts → createUpdateApplication.d.ts} +2 -2
  12. package/dist/applications/{updateApplication.js → createUpdateApplication.js} +7 -7
  13. package/dist/applications/utils/applicationWithEncodedStruct.js +2 -0
  14. package/dist/applications/utils/convertToApplicationData.d.ts +2 -2
  15. package/dist/applications/validation/assistantWithoutApiKeySchema.d.ts +671 -0
  16. package/dist/applications/validation/assistantWithoutApiKeySchema.js +35 -0
  17. package/dist/applications/validation/createValidationSchema.d.ts +1107 -0
  18. package/dist/applications/validation/createValidationSchema.js +67 -0
  19. package/dist/applications/validation/speechValidators.d.ts +29 -0
  20. package/dist/applications/{utils/getApplicationValidationSchema.js → validation/speechValidators.js} +3 -28
  21. package/dist/applications/{utils → validation}/validOrThrow.js +3 -2
  22. package/dist/calls/buildService.js +2 -2
  23. package/dist/calls/createCall.js +1 -2
  24. package/dist/calls/{makeTrackCall.d.ts → createTrackCall.d.ts} +2 -2
  25. package/dist/calls/{makeTrackCall.js → createTrackCall.js} +4 -4
  26. package/dist/calls/getCall.js +1 -2
  27. package/dist/calls/listCalls.js +1 -2
  28. package/dist/core/httpBridge.js +1 -1
  29. package/dist/core/runServices.js +2 -3
  30. package/dist/core/seed.js +11 -1
  31. package/dist/core/services.js +1 -1
  32. package/dist/envs.d.ts +1 -0
  33. package/dist/envs.js +3 -2
  34. package/dist/secrets/createGetFnUtil.js +12 -10
  35. package/dist/secrets/createSecret.js +1 -2
  36. package/dist/secrets/listSecrets.js +1 -2
  37. package/dist/secrets/updateSecret.js +1 -2
  38. package/dist/utils/createCheckNumberPreconditions.d.ts +6 -0
  39. package/dist/utils/{makeCheckNumberPreconditions.js → createCheckNumberPreconditions.js} +4 -4
  40. package/dist/utils/createHandleDialEventsWithNats.d.ts +5 -0
  41. package/dist/utils/{makeHandleDialEventsWithNats.js → createHandleDialEventsWithNats.js} +10 -8
  42. package/dist/utils/createHandleDialEventsWithVoiceClient.d.ts +5 -0
  43. package/dist/utils/{makeHandleDialEventsWithVoiceClient.js → createHandleDialEventsWithVoiceClient.js} +13 -11
  44. package/dist/utils/index.d.ts +3 -3
  45. package/dist/utils/index.js +3 -3
  46. package/dist/voice/VoiceClientImpl.js +13 -7
  47. package/dist/voice/VoiceDispatcher.js +16 -17
  48. package/dist/voice/connectToAri.js +3 -3
  49. package/dist/voice/{makeCreateVoiceClient.d.ts → createCreateVoiceClient.d.ts} +2 -2
  50. package/dist/voice/createCreateVoiceClient.js +76 -0
  51. package/dist/voice/handlers/createAnswerHandler.d.ts +5 -0
  52. package/dist/voice/handlers/{Answer.js → createAnswerHandler.js} +2 -2
  53. package/dist/voice/handlers/createHangupHandler.d.ts +5 -0
  54. package/dist/voice/handlers/{Hangup.js → createHangupHandler.js} +2 -2
  55. package/dist/voice/handlers/createMuteHandler.d.ts +4 -0
  56. package/dist/voice/handlers/{Mute.js → createMuteHandler.js} +2 -2
  57. package/dist/voice/handlers/createPlayDtmfHandler.d.ts +4 -0
  58. package/dist/voice/handlers/{PlayDtmf.js → createPlayDtmfHandler.js} +2 -2
  59. package/dist/voice/handlers/createPlayHandler.d.ts +4 -0
  60. package/dist/voice/handlers/{Play.js → createPlayHandler.js} +2 -2
  61. package/dist/voice/handlers/createPlaybackControlHandler.d.ts +4 -0
  62. package/dist/voice/handlers/{PlaybackControl.js → createPlaybackControlHandler.js} +2 -2
  63. package/dist/voice/handlers/createRecordHandler.d.ts +4 -0
  64. package/dist/voice/handlers/{Record.js → createRecordHandler.js} +2 -2
  65. package/dist/voice/handlers/createSayHandler.d.ts +4 -0
  66. package/dist/voice/handlers/{Say.js → createSayHandler.js} +2 -2
  67. package/dist/voice/handlers/createStreamGatherHandler.d.ts +3 -0
  68. package/dist/voice/handlers/{StreamGather.js → createStreamGatherHandler.js} +2 -2
  69. package/dist/voice/handlers/{StreamGather.d.ts → createStreamHandler.d.ts} +2 -2
  70. package/dist/voice/handlers/{Stream.js → createStreamHandler.js} +2 -2
  71. package/dist/voice/handlers/createUnmuteHandler.d.ts +4 -0
  72. package/dist/voice/handlers/{Unmute.js → createUnmuteHandler.js} +2 -2
  73. package/dist/voice/handlers/dial/createDialHandler.d.ts +5 -0
  74. package/dist/voice/handlers/dial/createDialHandler.js +78 -0
  75. package/dist/voice/handlers/dial/index.d.ts +1 -0
  76. package/dist/voice/handlers/dial/index.js +35 -0
  77. package/dist/voice/handlers/gather/createGatherHandler.d.ts +3 -0
  78. package/dist/voice/handlers/gather/{Gather.js → createGatherHandler.js} +2 -2
  79. package/dist/voice/handlers/index.d.ts +13 -12
  80. package/dist/voice/handlers/index.js +13 -12
  81. package/dist/voice/integrations/createCreateContainer.d.ts +4 -0
  82. package/dist/voice/integrations/{makeCreateContainer.js → createCreateContainer.js} +28 -26
  83. package/dist/voice/integrations/getSttConfig.js +20 -2
  84. package/dist/voice/integrations/getTtsConfig.js +2 -2
  85. package/dist/voice/integrations/index.d.ts +1 -1
  86. package/dist/voice/integrations/index.js +1 -1
  87. package/dist/voice/stt/types.d.ts +1 -1
  88. package/dist/voice/utils/createGetChannelVar.d.ts +4 -0
  89. package/dist/voice/utils/{makeGetChannelVar.js → createGetChannelVar.js} +14 -12
  90. package/dist/voice/utils/createGetChannelVarWithoutThrow.d.ts +4 -0
  91. package/dist/voice/utils/{makeGetChannelVarWithoutThrow.js → createGetChannelVarWithoutThrow.js} +14 -12
  92. package/dist/voice/utils/index.d.ts +2 -2
  93. package/dist/voice/utils/index.js +2 -2
  94. package/package.json +9 -9
  95. package/dist/applications/utils/getApplicationValidationSchema.d.ts +0 -64
  96. package/dist/utils/makeCheckNumberPreconditions.d.ts +0 -6
  97. package/dist/utils/makeHandleDialEventsWithNats.d.ts +0 -5
  98. package/dist/utils/makeHandleDialEventsWithVoiceClient.d.ts +0 -5
  99. package/dist/voice/handlers/Answer.d.ts +0 -5
  100. package/dist/voice/handlers/Hangup.d.ts +0 -5
  101. package/dist/voice/handlers/Mute.d.ts +0 -4
  102. package/dist/voice/handlers/Play.d.ts +0 -4
  103. package/dist/voice/handlers/PlayDtmf.d.ts +0 -4
  104. package/dist/voice/handlers/PlaybackControl.d.ts +0 -4
  105. package/dist/voice/handlers/Record.d.ts +0 -4
  106. package/dist/voice/handlers/Say.d.ts +0 -4
  107. package/dist/voice/handlers/Stream.d.ts +0 -3
  108. package/dist/voice/handlers/Unmute.d.ts +0 -4
  109. package/dist/voice/handlers/dial/Dial.d.ts +0 -5
  110. package/dist/voice/handlers/dial/Dial.js +0 -76
  111. package/dist/voice/handlers/gather/Gather.d.ts +0 -3
  112. package/dist/voice/integrations/findIntegrationsCredentials.d.ts +0 -3
  113. package/dist/voice/integrations/findIntegrationsCredentials.js +0 -7
  114. package/dist/voice/integrations/makeCreateContainer.d.ts +0 -4
  115. package/dist/voice/makeCreateVoiceClient.js +0 -74
  116. package/dist/voice/utils/makeGetChannelVar.d.ts +0 -4
  117. package/dist/voice/utils/makeGetChannelVarWithoutThrow.d.ts +0 -4
  118. /package/dist/applications/{utils → validation}/prepareForValidation.d.ts +0 -0
  119. /package/dist/applications/{utils → validation}/prepareForValidation.js +0 -0
  120. /package/dist/applications/{utils → validation}/validOrThrow.d.ts +0 -0
@@ -0,0 +1,671 @@
1
+ import { z } from "zod";
2
+ declare const assistantWithoutApiKeySchema: z.ZodObject<z.objectUtil.extendShape<{
3
+ conversationSettings: z.ZodObject<{
4
+ firstMessage: z.ZodOptional<z.ZodString>;
5
+ systemTemplate: z.ZodString;
6
+ goodbyeMessage: z.ZodString;
7
+ systemErrorMessage: z.ZodString;
8
+ initialDtmf: z.ZodOptional<z.ZodString>;
9
+ maxSpeechWaitTimeout: z.ZodNumber;
10
+ transferOptions: z.ZodOptional<z.ZodObject<{
11
+ phoneNumber: z.ZodString;
12
+ message: z.ZodString;
13
+ timeout: z.ZodOptional<z.ZodNumber>;
14
+ }, "strip", z.ZodTypeAny, {
15
+ message?: string;
16
+ phoneNumber?: string;
17
+ timeout?: number;
18
+ }, {
19
+ message?: string;
20
+ phoneNumber?: string;
21
+ timeout?: number;
22
+ }>>;
23
+ idleOptions: z.ZodOptional<z.ZodObject<{
24
+ message: z.ZodString;
25
+ timeout: z.ZodNumber;
26
+ maxTimeoutCount: z.ZodNumber;
27
+ }, "strip", z.ZodTypeAny, {
28
+ message?: string;
29
+ timeout?: number;
30
+ maxTimeoutCount?: number;
31
+ }, {
32
+ message?: string;
33
+ timeout?: number;
34
+ maxTimeoutCount?: number;
35
+ }>>;
36
+ vad: z.ZodObject<{
37
+ pathToModel: z.ZodOptional<z.ZodString>;
38
+ activationThreshold: z.ZodNumber;
39
+ deactivationThreshold: z.ZodNumber;
40
+ debounceFrames: z.ZodNumber;
41
+ }, "strip", z.ZodTypeAny, {
42
+ pathToModel?: string;
43
+ activationThreshold?: number;
44
+ deactivationThreshold?: number;
45
+ debounceFrames?: number;
46
+ }, {
47
+ pathToModel?: string;
48
+ activationThreshold?: number;
49
+ deactivationThreshold?: number;
50
+ debounceFrames?: number;
51
+ }>;
52
+ }, "strip", z.ZodTypeAny, {
53
+ firstMessage?: string;
54
+ systemTemplate?: string;
55
+ goodbyeMessage?: string;
56
+ systemErrorMessage?: string;
57
+ initialDtmf?: string;
58
+ maxSpeechWaitTimeout?: number;
59
+ transferOptions?: {
60
+ message?: string;
61
+ phoneNumber?: string;
62
+ timeout?: number;
63
+ };
64
+ idleOptions?: {
65
+ message?: string;
66
+ timeout?: number;
67
+ maxTimeoutCount?: number;
68
+ };
69
+ vad?: {
70
+ pathToModel?: string;
71
+ activationThreshold?: number;
72
+ deactivationThreshold?: number;
73
+ debounceFrames?: number;
74
+ };
75
+ }, {
76
+ firstMessage?: string;
77
+ systemTemplate?: string;
78
+ goodbyeMessage?: string;
79
+ systemErrorMessage?: string;
80
+ initialDtmf?: string;
81
+ maxSpeechWaitTimeout?: number;
82
+ transferOptions?: {
83
+ message?: string;
84
+ phoneNumber?: string;
85
+ timeout?: number;
86
+ };
87
+ idleOptions?: {
88
+ message?: string;
89
+ timeout?: number;
90
+ maxTimeoutCount?: number;
91
+ };
92
+ vad?: {
93
+ pathToModel?: string;
94
+ activationThreshold?: number;
95
+ deactivationThreshold?: number;
96
+ debounceFrames?: number;
97
+ };
98
+ }>;
99
+ languageModel: z.ZodObject<{
100
+ provider: z.ZodNativeEnum<typeof import("@fonoster/common").LanguageModelProvider>;
101
+ apiKey: z.ZodOptional<z.ZodString>;
102
+ model: z.ZodString;
103
+ temperature: z.ZodNumber;
104
+ maxTokens: z.ZodNumber;
105
+ baseUrl: z.ZodOptional<z.ZodString>;
106
+ knowledgeBase: z.ZodArray<z.ZodObject<{
107
+ type: z.ZodEnum<["s3"]>;
108
+ title: z.ZodString;
109
+ document: z.ZodString;
110
+ }, "strip", z.ZodTypeAny, {
111
+ type?: "s3";
112
+ title?: string;
113
+ document?: string;
114
+ }, {
115
+ type?: "s3";
116
+ title?: string;
117
+ document?: string;
118
+ }>, "many">;
119
+ tools: z.ZodArray<z.ZodObject<{
120
+ name: z.ZodString;
121
+ description: z.ZodString;
122
+ parameters: z.ZodObject<{
123
+ type: z.ZodEnum<["object", "array"]>;
124
+ properties: z.ZodRecord<z.ZodString, z.ZodEffects<z.ZodObject<{
125
+ type: z.ZodString;
126
+ format: z.ZodOptional<z.ZodString>;
127
+ pattern: z.ZodOptional<z.ZodString>;
128
+ }, "strip", z.ZodTypeAny, {
129
+ type?: string;
130
+ format?: string;
131
+ pattern?: string;
132
+ }, {
133
+ type?: string;
134
+ format?: string;
135
+ pattern?: string;
136
+ }>, {
137
+ type?: string;
138
+ format?: string;
139
+ pattern?: string;
140
+ }, {
141
+ type?: string;
142
+ format?: string;
143
+ pattern?: string;
144
+ }>>;
145
+ required: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
146
+ }, "strip", z.ZodTypeAny, {
147
+ type?: "object" | "array";
148
+ properties?: Record<string, {
149
+ type?: string;
150
+ format?: string;
151
+ pattern?: string;
152
+ }>;
153
+ required?: string[];
154
+ }, {
155
+ type?: "object" | "array";
156
+ properties?: Record<string, {
157
+ type?: string;
158
+ format?: string;
159
+ pattern?: string;
160
+ }>;
161
+ required?: string[];
162
+ }>;
163
+ requestStartMessage: z.ZodOptional<z.ZodString>;
164
+ operation: z.ZodEffects<z.ZodObject<{
165
+ type: z.ZodNativeEnum<typeof import("@fonoster/common/dist/assistants/tools/AllowedOperations").AllowedOperations>;
166
+ url: z.ZodOptional<z.ZodString>;
167
+ waitForResponse: z.ZodOptional<z.ZodBoolean>;
168
+ headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
169
+ }, "strip", z.ZodTypeAny, {
170
+ type?: import("@fonoster/common/dist/assistants/tools/AllowedOperations").AllowedOperations;
171
+ url?: string;
172
+ waitForResponse?: boolean;
173
+ headers?: Record<string, string>;
174
+ }, {
175
+ type?: import("@fonoster/common/dist/assistants/tools/AllowedOperations").AllowedOperations;
176
+ url?: string;
177
+ waitForResponse?: boolean;
178
+ headers?: Record<string, string>;
179
+ }>, {
180
+ type?: import("@fonoster/common/dist/assistants/tools/AllowedOperations").AllowedOperations;
181
+ url?: string;
182
+ waitForResponse?: boolean;
183
+ headers?: Record<string, string>;
184
+ }, {
185
+ type?: import("@fonoster/common/dist/assistants/tools/AllowedOperations").AllowedOperations;
186
+ url?: string;
187
+ waitForResponse?: boolean;
188
+ headers?: Record<string, string>;
189
+ }>;
190
+ }, "strip", z.ZodTypeAny, {
191
+ name?: string;
192
+ description?: string;
193
+ parameters?: {
194
+ type?: "object" | "array";
195
+ properties?: Record<string, {
196
+ type?: string;
197
+ format?: string;
198
+ pattern?: string;
199
+ }>;
200
+ required?: string[];
201
+ };
202
+ requestStartMessage?: string;
203
+ operation?: {
204
+ type?: import("@fonoster/common/dist/assistants/tools/AllowedOperations").AllowedOperations;
205
+ url?: string;
206
+ waitForResponse?: boolean;
207
+ headers?: Record<string, string>;
208
+ };
209
+ }, {
210
+ name?: string;
211
+ description?: string;
212
+ parameters?: {
213
+ type?: "object" | "array";
214
+ properties?: Record<string, {
215
+ type?: string;
216
+ format?: string;
217
+ pattern?: string;
218
+ }>;
219
+ required?: string[];
220
+ };
221
+ requestStartMessage?: string;
222
+ operation?: {
223
+ type?: import("@fonoster/common/dist/assistants/tools/AllowedOperations").AllowedOperations;
224
+ url?: string;
225
+ waitForResponse?: boolean;
226
+ headers?: Record<string, string>;
227
+ };
228
+ }>, "many">;
229
+ }, "strip", z.ZodTypeAny, {
230
+ provider?: import("@fonoster/common").LanguageModelProvider;
231
+ apiKey?: string;
232
+ model?: string;
233
+ temperature?: number;
234
+ maxTokens?: number;
235
+ baseUrl?: string;
236
+ knowledgeBase?: {
237
+ type?: "s3";
238
+ title?: string;
239
+ document?: string;
240
+ }[];
241
+ tools?: {
242
+ name?: string;
243
+ description?: string;
244
+ parameters?: {
245
+ type?: "object" | "array";
246
+ properties?: Record<string, {
247
+ type?: string;
248
+ format?: string;
249
+ pattern?: string;
250
+ }>;
251
+ required?: string[];
252
+ };
253
+ requestStartMessage?: string;
254
+ operation?: {
255
+ type?: import("@fonoster/common/dist/assistants/tools/AllowedOperations").AllowedOperations;
256
+ url?: string;
257
+ waitForResponse?: boolean;
258
+ headers?: Record<string, string>;
259
+ };
260
+ }[];
261
+ }, {
262
+ provider?: import("@fonoster/common").LanguageModelProvider;
263
+ apiKey?: string;
264
+ model?: string;
265
+ temperature?: number;
266
+ maxTokens?: number;
267
+ baseUrl?: string;
268
+ knowledgeBase?: {
269
+ type?: "s3";
270
+ title?: string;
271
+ document?: string;
272
+ }[];
273
+ tools?: {
274
+ name?: string;
275
+ description?: string;
276
+ parameters?: {
277
+ type?: "object" | "array";
278
+ properties?: Record<string, {
279
+ type?: string;
280
+ format?: string;
281
+ pattern?: string;
282
+ }>;
283
+ required?: string[];
284
+ };
285
+ requestStartMessage?: string;
286
+ operation?: {
287
+ type?: import("@fonoster/common/dist/assistants/tools/AllowedOperations").AllowedOperations;
288
+ url?: string;
289
+ waitForResponse?: boolean;
290
+ headers?: Record<string, string>;
291
+ };
292
+ }[];
293
+ }>;
294
+ }, {
295
+ languageModel: z.ZodEffects<z.ZodObject<{
296
+ provider: z.ZodNativeEnum<typeof import("@fonoster/common").LanguageModelProvider>;
297
+ apiKey: z.ZodOptional<z.ZodString>;
298
+ model: z.ZodString;
299
+ temperature: z.ZodNumber;
300
+ maxTokens: z.ZodNumber;
301
+ baseUrl: z.ZodOptional<z.ZodString>;
302
+ knowledgeBase: z.ZodArray<z.ZodObject<{
303
+ type: z.ZodEnum<["s3"]>;
304
+ title: z.ZodString;
305
+ document: z.ZodString;
306
+ }, "strip", z.ZodTypeAny, {
307
+ type?: "s3";
308
+ title?: string;
309
+ document?: string;
310
+ }, {
311
+ type?: "s3";
312
+ title?: string;
313
+ document?: string;
314
+ }>, "many">;
315
+ tools: z.ZodArray<z.ZodObject<{
316
+ name: z.ZodString;
317
+ description: z.ZodString;
318
+ parameters: z.ZodObject<{
319
+ type: z.ZodEnum<["object", "array"]>;
320
+ properties: z.ZodRecord<z.ZodString, z.ZodEffects<z.ZodObject<{
321
+ type: z.ZodString;
322
+ format: z.ZodOptional<z.ZodString>;
323
+ pattern: z.ZodOptional<z.ZodString>;
324
+ }, "strip", z.ZodTypeAny, {
325
+ type?: string;
326
+ format?: string;
327
+ pattern?: string;
328
+ }, {
329
+ type?: string;
330
+ format?: string;
331
+ pattern?: string;
332
+ }>, {
333
+ type?: string;
334
+ format?: string;
335
+ pattern?: string;
336
+ }, {
337
+ type?: string;
338
+ format?: string;
339
+ pattern?: string;
340
+ }>>;
341
+ required: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
342
+ }, "strip", z.ZodTypeAny, {
343
+ type?: "object" | "array";
344
+ properties?: Record<string, {
345
+ type?: string;
346
+ format?: string;
347
+ pattern?: string;
348
+ }>;
349
+ required?: string[];
350
+ }, {
351
+ type?: "object" | "array";
352
+ properties?: Record<string, {
353
+ type?: string;
354
+ format?: string;
355
+ pattern?: string;
356
+ }>;
357
+ required?: string[];
358
+ }>;
359
+ requestStartMessage: z.ZodOptional<z.ZodString>;
360
+ operation: z.ZodEffects<z.ZodObject<{
361
+ type: z.ZodNativeEnum<typeof import("@fonoster/common/dist/assistants/tools/AllowedOperations").AllowedOperations>;
362
+ url: z.ZodOptional<z.ZodString>;
363
+ waitForResponse: z.ZodOptional<z.ZodBoolean>;
364
+ headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
365
+ }, "strip", z.ZodTypeAny, {
366
+ type?: import("@fonoster/common/dist/assistants/tools/AllowedOperations").AllowedOperations;
367
+ url?: string;
368
+ waitForResponse?: boolean;
369
+ headers?: Record<string, string>;
370
+ }, {
371
+ type?: import("@fonoster/common/dist/assistants/tools/AllowedOperations").AllowedOperations;
372
+ url?: string;
373
+ waitForResponse?: boolean;
374
+ headers?: Record<string, string>;
375
+ }>, {
376
+ type?: import("@fonoster/common/dist/assistants/tools/AllowedOperations").AllowedOperations;
377
+ url?: string;
378
+ waitForResponse?: boolean;
379
+ headers?: Record<string, string>;
380
+ }, {
381
+ type?: import("@fonoster/common/dist/assistants/tools/AllowedOperations").AllowedOperations;
382
+ url?: string;
383
+ waitForResponse?: boolean;
384
+ headers?: Record<string, string>;
385
+ }>;
386
+ }, "strip", z.ZodTypeAny, {
387
+ name?: string;
388
+ description?: string;
389
+ parameters?: {
390
+ type?: "object" | "array";
391
+ properties?: Record<string, {
392
+ type?: string;
393
+ format?: string;
394
+ pattern?: string;
395
+ }>;
396
+ required?: string[];
397
+ };
398
+ requestStartMessage?: string;
399
+ operation?: {
400
+ type?: import("@fonoster/common/dist/assistants/tools/AllowedOperations").AllowedOperations;
401
+ url?: string;
402
+ waitForResponse?: boolean;
403
+ headers?: Record<string, string>;
404
+ };
405
+ }, {
406
+ name?: string;
407
+ description?: string;
408
+ parameters?: {
409
+ type?: "object" | "array";
410
+ properties?: Record<string, {
411
+ type?: string;
412
+ format?: string;
413
+ pattern?: string;
414
+ }>;
415
+ required?: string[];
416
+ };
417
+ requestStartMessage?: string;
418
+ operation?: {
419
+ type?: import("@fonoster/common/dist/assistants/tools/AllowedOperations").AllowedOperations;
420
+ url?: string;
421
+ waitForResponse?: boolean;
422
+ headers?: Record<string, string>;
423
+ };
424
+ }>, "many">;
425
+ }, "strip", z.ZodTypeAny, {
426
+ provider?: import("@fonoster/common").LanguageModelProvider;
427
+ apiKey?: string;
428
+ model?: string;
429
+ temperature?: number;
430
+ maxTokens?: number;
431
+ baseUrl?: string;
432
+ knowledgeBase?: {
433
+ type?: "s3";
434
+ title?: string;
435
+ document?: string;
436
+ }[];
437
+ tools?: {
438
+ name?: string;
439
+ description?: string;
440
+ parameters?: {
441
+ type?: "object" | "array";
442
+ properties?: Record<string, {
443
+ type?: string;
444
+ format?: string;
445
+ pattern?: string;
446
+ }>;
447
+ required?: string[];
448
+ };
449
+ requestStartMessage?: string;
450
+ operation?: {
451
+ type?: import("@fonoster/common/dist/assistants/tools/AllowedOperations").AllowedOperations;
452
+ url?: string;
453
+ waitForResponse?: boolean;
454
+ headers?: Record<string, string>;
455
+ };
456
+ }[];
457
+ }, {
458
+ provider?: import("@fonoster/common").LanguageModelProvider;
459
+ apiKey?: string;
460
+ model?: string;
461
+ temperature?: number;
462
+ maxTokens?: number;
463
+ baseUrl?: string;
464
+ knowledgeBase?: {
465
+ type?: "s3";
466
+ title?: string;
467
+ document?: string;
468
+ }[];
469
+ tools?: {
470
+ name?: string;
471
+ description?: string;
472
+ parameters?: {
473
+ type?: "object" | "array";
474
+ properties?: Record<string, {
475
+ type?: string;
476
+ format?: string;
477
+ pattern?: string;
478
+ }>;
479
+ required?: string[];
480
+ };
481
+ requestStartMessage?: string;
482
+ operation?: {
483
+ type?: import("@fonoster/common/dist/assistants/tools/AllowedOperations").AllowedOperations;
484
+ url?: string;
485
+ waitForResponse?: boolean;
486
+ headers?: Record<string, string>;
487
+ };
488
+ }[];
489
+ }>, {
490
+ provider?: import("@fonoster/common").LanguageModelProvider;
491
+ apiKey?: string;
492
+ model?: string;
493
+ temperature?: number;
494
+ maxTokens?: number;
495
+ baseUrl?: string;
496
+ knowledgeBase?: {
497
+ type?: "s3";
498
+ title?: string;
499
+ document?: string;
500
+ }[];
501
+ tools?: {
502
+ name?: string;
503
+ description?: string;
504
+ parameters?: {
505
+ type?: "object" | "array";
506
+ properties?: Record<string, {
507
+ type?: string;
508
+ format?: string;
509
+ pattern?: string;
510
+ }>;
511
+ required?: string[];
512
+ };
513
+ requestStartMessage?: string;
514
+ operation?: {
515
+ type?: import("@fonoster/common/dist/assistants/tools/AllowedOperations").AllowedOperations;
516
+ url?: string;
517
+ waitForResponse?: boolean;
518
+ headers?: Record<string, string>;
519
+ };
520
+ }[];
521
+ }, {
522
+ provider?: import("@fonoster/common").LanguageModelProvider;
523
+ apiKey?: string;
524
+ model?: string;
525
+ temperature?: number;
526
+ maxTokens?: number;
527
+ baseUrl?: string;
528
+ knowledgeBase?: {
529
+ type?: "s3";
530
+ title?: string;
531
+ document?: string;
532
+ }[];
533
+ tools?: {
534
+ name?: string;
535
+ description?: string;
536
+ parameters?: {
537
+ type?: "object" | "array";
538
+ properties?: Record<string, {
539
+ type?: string;
540
+ format?: string;
541
+ pattern?: string;
542
+ }>;
543
+ required?: string[];
544
+ };
545
+ requestStartMessage?: string;
546
+ operation?: {
547
+ type?: import("@fonoster/common/dist/assistants/tools/AllowedOperations").AllowedOperations;
548
+ url?: string;
549
+ waitForResponse?: boolean;
550
+ headers?: Record<string, string>;
551
+ };
552
+ }[];
553
+ }>;
554
+ }>, "strip", z.ZodTypeAny, {
555
+ languageModel?: {
556
+ provider?: import("@fonoster/common").LanguageModelProvider;
557
+ apiKey?: string;
558
+ model?: string;
559
+ temperature?: number;
560
+ maxTokens?: number;
561
+ baseUrl?: string;
562
+ knowledgeBase?: {
563
+ type?: "s3";
564
+ title?: string;
565
+ document?: string;
566
+ }[];
567
+ tools?: {
568
+ name?: string;
569
+ description?: string;
570
+ parameters?: {
571
+ type?: "object" | "array";
572
+ properties?: Record<string, {
573
+ type?: string;
574
+ format?: string;
575
+ pattern?: string;
576
+ }>;
577
+ required?: string[];
578
+ };
579
+ requestStartMessage?: string;
580
+ operation?: {
581
+ type?: import("@fonoster/common/dist/assistants/tools/AllowedOperations").AllowedOperations;
582
+ url?: string;
583
+ waitForResponse?: boolean;
584
+ headers?: Record<string, string>;
585
+ };
586
+ }[];
587
+ };
588
+ conversationSettings?: {
589
+ firstMessage?: string;
590
+ systemTemplate?: string;
591
+ goodbyeMessage?: string;
592
+ systemErrorMessage?: string;
593
+ initialDtmf?: string;
594
+ maxSpeechWaitTimeout?: number;
595
+ transferOptions?: {
596
+ message?: string;
597
+ phoneNumber?: string;
598
+ timeout?: number;
599
+ };
600
+ idleOptions?: {
601
+ message?: string;
602
+ timeout?: number;
603
+ maxTimeoutCount?: number;
604
+ };
605
+ vad?: {
606
+ pathToModel?: string;
607
+ activationThreshold?: number;
608
+ deactivationThreshold?: number;
609
+ debounceFrames?: number;
610
+ };
611
+ };
612
+ }, {
613
+ languageModel?: {
614
+ provider?: import("@fonoster/common").LanguageModelProvider;
615
+ apiKey?: string;
616
+ model?: string;
617
+ temperature?: number;
618
+ maxTokens?: number;
619
+ baseUrl?: string;
620
+ knowledgeBase?: {
621
+ type?: "s3";
622
+ title?: string;
623
+ document?: string;
624
+ }[];
625
+ tools?: {
626
+ name?: string;
627
+ description?: string;
628
+ parameters?: {
629
+ type?: "object" | "array";
630
+ properties?: Record<string, {
631
+ type?: string;
632
+ format?: string;
633
+ pattern?: string;
634
+ }>;
635
+ required?: string[];
636
+ };
637
+ requestStartMessage?: string;
638
+ operation?: {
639
+ type?: import("@fonoster/common/dist/assistants/tools/AllowedOperations").AllowedOperations;
640
+ url?: string;
641
+ waitForResponse?: boolean;
642
+ headers?: Record<string, string>;
643
+ };
644
+ }[];
645
+ };
646
+ conversationSettings?: {
647
+ firstMessage?: string;
648
+ systemTemplate?: string;
649
+ goodbyeMessage?: string;
650
+ systemErrorMessage?: string;
651
+ initialDtmf?: string;
652
+ maxSpeechWaitTimeout?: number;
653
+ transferOptions?: {
654
+ message?: string;
655
+ phoneNumber?: string;
656
+ timeout?: number;
657
+ };
658
+ idleOptions?: {
659
+ message?: string;
660
+ timeout?: number;
661
+ maxTimeoutCount?: number;
662
+ };
663
+ vad?: {
664
+ pathToModel?: string;
665
+ activationThreshold?: number;
666
+ deactivationThreshold?: number;
667
+ debounceFrames?: number;
668
+ };
669
+ };
670
+ }>;
671
+ export { assistantWithoutApiKeySchema };
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.assistantWithoutApiKeySchema = void 0;
4
+ /*
5
+ * Copyright (C) 2024 by Fonoster Inc (https://fonoster.com)
6
+ * http://github.com/fonoster/fonoster
7
+ *
8
+ * This file is part of Fonoster
9
+ *
10
+ * Licensed under the MIT License (the "License");
11
+ * you may not use this file except in compliance with
12
+ * the License. You may obtain a copy of the License at
13
+ *
14
+ * https://opensource.org/licenses/MIT
15
+ *
16
+ * Unless required by applicable law or agreed to in writing, software
17
+ * distributed under the License is distributed on an "AS IS" BASIS,
18
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19
+ * See the License for the specific language governing permissions and
20
+ * limitations under the License.
21
+ */
22
+ const common_1 = require("@fonoster/common");
23
+ const zod_1 = require("zod");
24
+ const assistantWithoutApiKeySchema = common_1.assistantSchema.extend({
25
+ languageModel: common_1.assistantSchema.shape.languageModel.superRefine((data, ctx) => {
26
+ if ("apiKey" in data) {
27
+ ctx.addIssue({
28
+ code: zod_1.z.ZodIssueCode.custom,
29
+ message: "apiKey is not allowed in languageModel",
30
+ path: ["apiKey"]
31
+ });
32
+ }
33
+ })
34
+ });
35
+ exports.assistantWithoutApiKeySchema = assistantWithoutApiKeySchema;