@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.
- package/dist/assistants/index.d.ts +2 -6
- package/dist/assistants/index.js +2 -6
- package/dist/assistants/sessionAssistantSchema.d.ts +741 -0
- package/dist/assistants/sessionAssistantSchema.js +112 -0
- package/dist/assistants/testCasesSchema.d.ts +4 -4
- package/dist/{voice/Dial.d.ts → calls/index.d.ts} +16 -13
- package/dist/calls/index.js +44 -0
- package/dist/cellsecrets/index.d.ts +91 -0
- package/dist/cellsecrets/index.js +299 -0
- package/dist/config/cli/check.d.ts +6 -0
- package/dist/config/cli/check.js +202 -0
- package/dist/config/cli/envFile.d.ts +23 -0
- package/dist/config/cli/envFile.js +81 -0
- package/dist/config/cli/exposure.d.ts +10 -0
- package/dist/config/cli/exposure.js +93 -0
- package/dist/config/cli/index.d.ts +2 -0
- package/dist/{identity/tokenHasAccessKeyId.js → config/cli/index.js} +7 -8
- package/dist/config/cli/info.d.ts +6 -0
- package/dist/config/cli/info.js +62 -0
- package/dist/config/cli/init.d.ts +9 -0
- package/dist/config/cli/init.js +152 -0
- package/dist/config/cli/main.d.ts +11 -0
- package/dist/config/cli/main.js +155 -0
- package/dist/config/cli/render.d.ts +44 -0
- package/dist/config/cli/render.js +129 -0
- package/dist/config/cli/secrets.d.ts +21 -0
- package/dist/config/cli/secrets.js +117 -0
- package/dist/{utils/findIntegrationsCredentials.d.ts → config/cli/types.d.ts} +6 -5
- package/dist/config/cli/types.js +7 -0
- package/dist/config/configHints.d.ts +39 -0
- package/dist/config/configHints.js +61 -0
- package/dist/{voice → config}/index.d.ts +12 -13
- package/dist/config/index.js +46 -0
- package/dist/config/integrationsSchema.d.ts +32 -0
- package/dist/config/integrationsSchema.js +56 -0
- package/dist/config/interpolateEnv.d.ts +34 -0
- package/dist/config/interpolateEnv.js +70 -0
- package/dist/config/loadServiceConfig.d.ts +33 -0
- package/dist/config/loadServiceConfig.js +121 -0
- package/dist/config/logsSchema.d.ts +76 -0
- package/dist/config/logsSchema.js +49 -0
- package/dist/config/natsConnection.d.ts +53 -0
- package/dist/config/natsConnection.js +58 -0
- package/dist/config/parseConfigFile.d.ts +7 -0
- package/dist/config/parseConfigFile.js +60 -0
- package/dist/config/resolveConfigFile.d.ts +17 -0
- package/dist/config/resolveConfigFile.js +54 -0
- package/dist/config/resolveSecretRefs.d.ts +35 -0
- package/dist/config/resolveSecretRefs.js +129 -0
- package/dist/{assistants/audioFiltersSchema.d.ts → config/strictDeep.d.ts} +9 -12
- package/dist/config/strictDeep.js +58 -0
- package/dist/config/telemetrySchema.d.ts +39 -0
- package/dist/config/telemetrySchema.js +44 -0
- package/dist/config/toJsonSchema.d.ts +30 -0
- package/dist/config/toJsonSchema.js +161 -0
- package/dist/constants.d.ts +1 -4
- package/dist/constants.js +4 -5
- package/dist/envs.d.ts +2 -1
- package/dist/envs.js +13 -11
- package/dist/identity/createAuthInterceptor.d.ts +9 -2
- package/dist/identity/createAuthInterceptor.js +36 -30
- package/dist/identity/hasAccess.d.ts +9 -3
- package/dist/identity/hasAccess.js +32 -8
- package/dist/identity/index.d.ts +1 -0
- package/dist/identity/index.js +1 -0
- package/dist/identity/isValidToken.d.ts +12 -2
- package/dist/identity/isValidToken.js +25 -9
- package/dist/identity/roles.js +22 -6
- package/dist/identity/types.d.ts +6 -1
- package/dist/identity/types.js +1 -0
- package/dist/{assistants/LanguageModelProvider.js → identity/verifyAccessToken.d.ts} +10 -11
- package/dist/identity/verifyAccessToken.js +44 -0
- package/dist/index.d.ts +11 -1
- package/dist/index.js +14 -2
- package/dist/net/assertPublicDestination.d.ts +52 -0
- package/dist/net/assertPublicDestination.js +342 -0
- package/dist/{voice/PlayDtmf.d.ts → net/index.d.ts} +1 -5
- package/dist/{voice → net}/index.js +1 -13
- package/dist/notifications/createSendEmail.js +3 -1
- package/dist/protos/applications.proto +124 -3
- package/dist/protos/authz.proto +23 -4
- package/dist/protos/capabilities.proto +94 -0
- package/dist/protos/identity.proto +26 -1
- package/dist/protos/providers.proto +135 -0
- package/dist/protos/webhooks.proto +140 -0
- package/dist/{voice/StopSay.d.ts → regions/hub/index.d.ts} +1 -6
- package/dist/regions/hub/index.js +35 -0
- package/dist/regions/hub/natsJwt.d.ts +63 -0
- package/dist/regions/hub/natsJwt.js +195 -0
- package/dist/registry/Registry.d.ts +79 -0
- package/dist/registry/Registry.js +418 -0
- package/dist/registry/cli.d.ts +20 -0
- package/dist/registry/cli.js +424 -0
- package/dist/{assistants/audioFiltersSchema.js → registry/features.d.ts} +13 -14
- package/dist/registry/features.js +36 -0
- package/dist/{assistants/LanguageModelProvider.d.ts → registry/index.d.ts} +6 -8
- package/dist/registry/index.js +40 -0
- package/dist/registry/prisma.d.ts +67 -0
- package/dist/registry/prisma.js +391 -0
- package/dist/registry/stores.d.ts +21 -0
- package/dist/{assistants/eventsHookSchema.js → registry/stores.js} +55 -18
- package/dist/registry/types.d.ts +98 -0
- package/dist/{voice/Say.d.ts → registry/types.js} +4 -10
- package/dist/registry/workspaceKeys.d.ts +41 -0
- package/dist/registry/workspaceKeys.js +64 -0
- package/dist/session/index.d.ts +19 -0
- package/dist/session/index.js +35 -0
- package/dist/session/schema.d.ts +1951 -0
- package/dist/session/schema.js +397 -0
- package/dist/sessions/index.d.ts +93 -0
- package/dist/sessions/index.js +194 -0
- package/dist/telemetry.d.ts +76 -0
- package/dist/telemetry.js +360 -0
- package/dist/types.d.ts +3 -5
- package/dist/utils/{findIntegrationsCredentials.js → WriteBehind.d.ts} +13 -10
- package/dist/utils/WriteBehind.js +64 -0
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.js +1 -1
- package/dist/{voice/Play.d.ts → utils/logUnhandledRejections.d.ts} +8 -12
- package/dist/utils/logUnhandledRejections.js +37 -0
- package/dist/validators/calls.d.ts +2 -2
- package/dist/validators/calls.js +5 -2
- package/dist/validators/identity.d.ts +37 -8
- package/dist/validators/identity.js +22 -3
- package/dist/validators/index.d.ts +1 -0
- package/dist/validators/index.js +1 -0
- package/dist/validators/sip.d.ts +40 -0
- package/dist/validators/sip.js +99 -0
- package/dist/validators/sipnet/credentials.d.ts +2 -2
- package/dist/validators/sipnet/domains.js +7 -7
- package/dist/validators/sipnet/trunks.d.ts +14 -14
- package/dist/validators/sipnet/trunks.js +4 -2
- package/dist/webhooks/Dispatcher.d.ts +87 -0
- package/dist/webhooks/Dispatcher.js +225 -0
- package/dist/webhooks/bus.d.ts +49 -0
- package/dist/webhooks/bus.js +170 -0
- package/dist/webhooks/events.d.ts +66 -0
- package/dist/webhooks/events.js +62 -0
- package/dist/webhooks/index.d.ts +23 -0
- package/dist/webhooks/index.js +39 -0
- package/dist/webhooks/prisma.d.ts +55 -0
- package/dist/webhooks/prisma.js +242 -0
- package/dist/webhooks/signing.d.ts +8 -0
- package/dist/webhooks/signing.js +53 -0
- package/package.json +25 -12
- package/schema/session.v1.json +791 -0
- package/dist/assistants/assistantSchema.d.ts +0 -739
- package/dist/assistants/assistantSchema.js +0 -37
- package/dist/assistants/conversationSettingsSchema.d.ts +0 -122
- package/dist/assistants/conversationSettingsSchema.js +0 -133
- package/dist/assistants/eventsHookSchema.d.ts +0 -38
- package/dist/assistants/languageModelConfigSchema.d.ts +0 -206
- package/dist/assistants/languageModelConfigSchema.js +0 -91
- package/dist/identity/tokenHasAccessKeyId.d.ts +0 -2
- package/dist/protos/voice.proto +0 -557
- package/dist/voice/Dial.js +0 -20
- package/dist/voice/Gather.d.ts +0 -37
- package/dist/voice/Gather.js +0 -9
- package/dist/voice/Mute.d.ts +0 -31
- package/dist/voice/Mute.js +0 -9
- package/dist/voice/Play.js +0 -2
- package/dist/voice/PlayDtmf.js +0 -2
- package/dist/voice/PlaybackControl.d.ts +0 -31
- package/dist/voice/PlaybackControl.js +0 -11
- package/dist/voice/Record.d.ts +0 -36
- package/dist/voice/Record.js +0 -7
- package/dist/voice/Say.js +0 -2
- package/dist/voice/StopSay.js +0 -2
- package/dist/voice/Stream.d.ts +0 -53
- package/dist/voice/Stream.js +0 -19
- package/dist/voice/StreamGather.d.ts +0 -34
- package/dist/voice/StreamGather.js +0 -9
- package/dist/voice/Verb.d.ts +0 -27
- package/dist/voice/Verb.js +0 -2
- package/dist/voice/voice.d.ts +0 -171
- package/dist/voice/voice.js +0 -65
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.assistantSchema = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* Copyright (C) 2025 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 zod_1 = require("zod");
|
|
23
|
-
const audioFiltersSchema_1 = require("./audioFiltersSchema");
|
|
24
|
-
const conversationSettingsSchema_1 = require("./conversationSettingsSchema");
|
|
25
|
-
const eventsHookSchema_1 = require("./eventsHookSchema");
|
|
26
|
-
const languageModelConfigSchema_1 = require("./languageModelConfigSchema");
|
|
27
|
-
const testCasesSchema_1 = require("./testCasesSchema");
|
|
28
|
-
const assistantSchema = zod_1.z.object({
|
|
29
|
-
// Audio filters the Media Server runs on the caller's audio, before speech
|
|
30
|
-
// recognition and voice activity detection. Optional; none by default.
|
|
31
|
-
audioFilters: audioFiltersSchema_1.audioFiltersSchema,
|
|
32
|
-
conversationSettings: conversationSettingsSchema_1.conversationSettingsSchema,
|
|
33
|
-
languageModel: languageModelConfigSchema_1.languageModelConfigSchema,
|
|
34
|
-
eventsHook: eventsHookSchema_1.eventsHookSchema.optional(),
|
|
35
|
-
testCases: testCasesSchema_1.testCasesSchema.optional()
|
|
36
|
-
});
|
|
37
|
-
exports.assistantSchema = assistantSchema;
|
|
@@ -1,122 +0,0 @@
|
|
|
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
|
-
declare const conversationSettingsSchema: z.ZodObject<{
|
|
21
|
-
firstMessage: z.ZodOptional<z.ZodString>;
|
|
22
|
-
systemPrompt: z.ZodString;
|
|
23
|
-
goodbyeMessage: z.ZodString;
|
|
24
|
-
systemErrorMessage: z.ZodString;
|
|
25
|
-
initialDtmf: z.ZodOptional<z.ZodString>;
|
|
26
|
-
maxSessionDuration: z.ZodDefault<z.ZodNumber>;
|
|
27
|
-
maxSpeechWaitTimeout: z.ZodDefault<z.ZodNumber>;
|
|
28
|
-
transferOptions: z.ZodOptional<z.ZodObject<{
|
|
29
|
-
phoneNumber: z.ZodString;
|
|
30
|
-
message: z.ZodString;
|
|
31
|
-
timeout: z.ZodDefault<z.ZodNumber>;
|
|
32
|
-
}, "strip", z.ZodTypeAny, {
|
|
33
|
-
message?: string;
|
|
34
|
-
phoneNumber?: string;
|
|
35
|
-
timeout?: number;
|
|
36
|
-
}, {
|
|
37
|
-
message?: string;
|
|
38
|
-
phoneNumber?: string;
|
|
39
|
-
timeout?: number;
|
|
40
|
-
}>>;
|
|
41
|
-
idleOptions: z.ZodObject<{
|
|
42
|
-
message: z.ZodString;
|
|
43
|
-
timeout: z.ZodDefault<z.ZodNumber>;
|
|
44
|
-
maxTimeoutCount: z.ZodDefault<z.ZodNumber>;
|
|
45
|
-
}, "strip", z.ZodTypeAny, {
|
|
46
|
-
message?: string;
|
|
47
|
-
timeout?: number;
|
|
48
|
-
maxTimeoutCount?: number;
|
|
49
|
-
}, {
|
|
50
|
-
message?: string;
|
|
51
|
-
timeout?: number;
|
|
52
|
-
maxTimeoutCount?: number;
|
|
53
|
-
}>;
|
|
54
|
-
allowUserBargeIn: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
55
|
-
vad: z.ZodDefault<z.ZodObject<{
|
|
56
|
-
pathToModel: z.ZodOptional<z.ZodString>;
|
|
57
|
-
activationThreshold: z.ZodNumber;
|
|
58
|
-
deactivationThreshold: z.ZodNumber;
|
|
59
|
-
debounceFrames: z.ZodNumber;
|
|
60
|
-
}, "strip", z.ZodTypeAny, {
|
|
61
|
-
pathToModel?: string;
|
|
62
|
-
activationThreshold?: number;
|
|
63
|
-
deactivationThreshold?: number;
|
|
64
|
-
debounceFrames?: number;
|
|
65
|
-
}, {
|
|
66
|
-
pathToModel?: string;
|
|
67
|
-
activationThreshold?: number;
|
|
68
|
-
deactivationThreshold?: number;
|
|
69
|
-
debounceFrames?: number;
|
|
70
|
-
}>>;
|
|
71
|
-
}, "strip", z.ZodTypeAny, {
|
|
72
|
-
firstMessage?: string;
|
|
73
|
-
systemPrompt?: string;
|
|
74
|
-
goodbyeMessage?: string;
|
|
75
|
-
systemErrorMessage?: string;
|
|
76
|
-
initialDtmf?: string;
|
|
77
|
-
maxSessionDuration?: number;
|
|
78
|
-
maxSpeechWaitTimeout?: number;
|
|
79
|
-
transferOptions?: {
|
|
80
|
-
message?: string;
|
|
81
|
-
phoneNumber?: string;
|
|
82
|
-
timeout?: number;
|
|
83
|
-
};
|
|
84
|
-
idleOptions?: {
|
|
85
|
-
message?: string;
|
|
86
|
-
timeout?: number;
|
|
87
|
-
maxTimeoutCount?: number;
|
|
88
|
-
};
|
|
89
|
-
allowUserBargeIn?: boolean;
|
|
90
|
-
vad?: {
|
|
91
|
-
pathToModel?: string;
|
|
92
|
-
activationThreshold?: number;
|
|
93
|
-
deactivationThreshold?: number;
|
|
94
|
-
debounceFrames?: number;
|
|
95
|
-
};
|
|
96
|
-
}, {
|
|
97
|
-
firstMessage?: string;
|
|
98
|
-
systemPrompt?: string;
|
|
99
|
-
goodbyeMessage?: string;
|
|
100
|
-
systemErrorMessage?: string;
|
|
101
|
-
initialDtmf?: string;
|
|
102
|
-
maxSessionDuration?: number;
|
|
103
|
-
maxSpeechWaitTimeout?: number;
|
|
104
|
-
transferOptions?: {
|
|
105
|
-
message?: string;
|
|
106
|
-
phoneNumber?: string;
|
|
107
|
-
timeout?: number;
|
|
108
|
-
};
|
|
109
|
-
idleOptions?: {
|
|
110
|
-
message?: string;
|
|
111
|
-
timeout?: number;
|
|
112
|
-
maxTimeoutCount?: number;
|
|
113
|
-
};
|
|
114
|
-
allowUserBargeIn?: boolean;
|
|
115
|
-
vad?: {
|
|
116
|
-
pathToModel?: string;
|
|
117
|
-
activationThreshold?: number;
|
|
118
|
-
deactivationThreshold?: number;
|
|
119
|
-
debounceFrames?: number;
|
|
120
|
-
};
|
|
121
|
-
}>;
|
|
122
|
-
export { conversationSettingsSchema };
|
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.conversationSettingsSchema = void 0;
|
|
37
|
-
/**
|
|
38
|
-
* Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
|
|
39
|
-
* http://github.com/fonoster/fonoster
|
|
40
|
-
*
|
|
41
|
-
* This file is part of Fonoster
|
|
42
|
-
*
|
|
43
|
-
* Licensed under the MIT License (the "License");
|
|
44
|
-
* you may not use this file except in compliance with
|
|
45
|
-
* the License. You may obtain a copy of the License at
|
|
46
|
-
*
|
|
47
|
-
* https://opensource.org/licenses/MIT
|
|
48
|
-
*
|
|
49
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
50
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
51
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
52
|
-
* See the License for the specific language governing permissions and
|
|
53
|
-
* limitations under the License.
|
|
54
|
-
*/
|
|
55
|
-
const zod_1 = require("zod");
|
|
56
|
-
const Messages = __importStar(require("../messages"));
|
|
57
|
-
const ZERO_OR_GREATER_THAN_ZERO = "Must be a number greater than or equal to 0";
|
|
58
|
-
const NUMBER_BETWEEN_0_AND_1 = "Must be a number between 0 and 1";
|
|
59
|
-
const MAX_SPEECH_WAIT_TIMEOUT = 0;
|
|
60
|
-
const IDLE_OPTIONS_TIMEOUT = 30000;
|
|
61
|
-
const IDLE_OPTIONS_MAX_TIMEOUT_COUNT = 2;
|
|
62
|
-
const VAD_ACTIVATION_THRESHOLD = 0.4;
|
|
63
|
-
const VAD_DEACTIVATION_THRESHOLD = 0.25;
|
|
64
|
-
const VAD_DEBOUNCE_FRAMES = 4;
|
|
65
|
-
const conversationSettingsSchema = zod_1.z.object({
|
|
66
|
-
firstMessage: zod_1.z.string().optional(),
|
|
67
|
-
systemPrompt: zod_1.z.string(),
|
|
68
|
-
goodbyeMessage: zod_1.z.string(),
|
|
69
|
-
systemErrorMessage: zod_1.z.string(),
|
|
70
|
-
initialDtmf: zod_1.z
|
|
71
|
-
.string()
|
|
72
|
-
.regex(/^[0-9*#]+$/, { message: Messages.VALID_DTMF })
|
|
73
|
-
.optional(),
|
|
74
|
-
maxSessionDuration: zod_1.z
|
|
75
|
-
.number()
|
|
76
|
-
.int()
|
|
77
|
-
.positive()
|
|
78
|
-
.default(30 * 60 * 1000), // 30 minutes
|
|
79
|
-
maxSpeechWaitTimeout: zod_1.z
|
|
80
|
-
.number()
|
|
81
|
-
.int({ message: Messages.POSITIVE_INTEGER_MESSAGE })
|
|
82
|
-
.gte(0, { message: ZERO_OR_GREATER_THAN_ZERO })
|
|
83
|
-
.default(MAX_SPEECH_WAIT_TIMEOUT),
|
|
84
|
-
transferOptions: zod_1.z
|
|
85
|
-
.object({
|
|
86
|
-
phoneNumber: zod_1.z.string(),
|
|
87
|
-
message: zod_1.z.string(),
|
|
88
|
-
timeout: zod_1.z
|
|
89
|
-
.number()
|
|
90
|
-
.int({ message: Messages.POSITIVE_INTEGER_MESSAGE })
|
|
91
|
-
.positive({ message: Messages.POSITIVE_INTEGER_MESSAGE })
|
|
92
|
-
.default(30000)
|
|
93
|
-
})
|
|
94
|
-
.optional(),
|
|
95
|
-
idleOptions: zod_1.z.object({
|
|
96
|
-
message: zod_1.z.string(),
|
|
97
|
-
timeout: zod_1.z
|
|
98
|
-
.number()
|
|
99
|
-
.int({ message: Messages.POSITIVE_INTEGER_MESSAGE })
|
|
100
|
-
.positive({ message: Messages.POSITIVE_INTEGER_MESSAGE })
|
|
101
|
-
.default(IDLE_OPTIONS_TIMEOUT),
|
|
102
|
-
maxTimeoutCount: zod_1.z
|
|
103
|
-
.number()
|
|
104
|
-
.int({ message: Messages.POSITIVE_INTEGER_MESSAGE })
|
|
105
|
-
.positive({ message: Messages.POSITIVE_INTEGER_MESSAGE })
|
|
106
|
-
.default(IDLE_OPTIONS_MAX_TIMEOUT_COUNT)
|
|
107
|
-
}),
|
|
108
|
-
allowUserBargeIn: zod_1.z.boolean().optional().default(true),
|
|
109
|
-
vad: zod_1.z
|
|
110
|
-
.object({
|
|
111
|
-
pathToModel: zod_1.z.string().optional(),
|
|
112
|
-
activationThreshold: zod_1.z
|
|
113
|
-
.number()
|
|
114
|
-
.max(1)
|
|
115
|
-
.min(0)
|
|
116
|
-
.positive({ message: NUMBER_BETWEEN_0_AND_1 }),
|
|
117
|
-
deactivationThreshold: zod_1.z
|
|
118
|
-
.number()
|
|
119
|
-
.max(1)
|
|
120
|
-
.min(0)
|
|
121
|
-
.positive({ message: NUMBER_BETWEEN_0_AND_1 }),
|
|
122
|
-
debounceFrames: zod_1.z
|
|
123
|
-
.number()
|
|
124
|
-
.int({ message: Messages.POSITIVE_INTEGER_MESSAGE })
|
|
125
|
-
.positive({ message: Messages.POSITIVE_INTEGER_MESSAGE })
|
|
126
|
-
})
|
|
127
|
-
.default({
|
|
128
|
-
activationThreshold: VAD_ACTIVATION_THRESHOLD,
|
|
129
|
-
deactivationThreshold: VAD_DEACTIVATION_THRESHOLD,
|
|
130
|
-
debounceFrames: VAD_DEBOUNCE_FRAMES
|
|
131
|
-
})
|
|
132
|
-
});
|
|
133
|
-
exports.conversationSettingsSchema = conversationSettingsSchema;
|
|
@@ -1,38 +0,0 @@
|
|
|
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
|
-
declare enum EventsHookAllowedEvents {
|
|
21
|
-
ALL = "all",
|
|
22
|
-
CONVERSATION_STARTED = "conversation.started",
|
|
23
|
-
CONVERSATION_ENDED = "conversation.ended"
|
|
24
|
-
}
|
|
25
|
-
declare const eventsHookSchema: z.ZodObject<{
|
|
26
|
-
url: z.ZodString;
|
|
27
|
-
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
28
|
-
events: z.ZodDefault<z.ZodArray<z.ZodNativeEnum<typeof EventsHookAllowedEvents>, "many">>;
|
|
29
|
-
}, "strip", z.ZodTypeAny, {
|
|
30
|
-
url?: string;
|
|
31
|
-
headers?: Record<string, string>;
|
|
32
|
-
events?: EventsHookAllowedEvents[];
|
|
33
|
-
}, {
|
|
34
|
-
url?: string;
|
|
35
|
-
headers?: Record<string, string>;
|
|
36
|
-
events?: EventsHookAllowedEvents[];
|
|
37
|
-
}>;
|
|
38
|
-
export { eventsHookSchema, EventsHookAllowedEvents };
|
|
@@ -1,206 +0,0 @@
|
|
|
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
|
-
import { LanguageModelProvider } from "./LanguageModelProvider";
|
|
21
|
-
declare const languageModelConfigSchema: z.ZodObject<{
|
|
22
|
-
provider: z.ZodNativeEnum<typeof LanguageModelProvider>;
|
|
23
|
-
apiKey: z.ZodOptional<z.ZodString>;
|
|
24
|
-
model: z.ZodString;
|
|
25
|
-
temperature: z.ZodNumber;
|
|
26
|
-
maxTokens: z.ZodNumber;
|
|
27
|
-
baseUrl: z.ZodOptional<z.ZodString>;
|
|
28
|
-
knowledgeBase: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
29
|
-
type: z.ZodEnum<["s3"]>;
|
|
30
|
-
title: z.ZodString;
|
|
31
|
-
document: z.ZodString;
|
|
32
|
-
}, "strip", z.ZodTypeAny, {
|
|
33
|
-
type?: "s3";
|
|
34
|
-
title?: string;
|
|
35
|
-
document?: string;
|
|
36
|
-
}, {
|
|
37
|
-
type?: "s3";
|
|
38
|
-
title?: string;
|
|
39
|
-
document?: string;
|
|
40
|
-
}>, "many">>;
|
|
41
|
-
tools: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
42
|
-
name: z.ZodString;
|
|
43
|
-
description: z.ZodString;
|
|
44
|
-
parameters: z.ZodObject<{
|
|
45
|
-
type: z.ZodEnum<["object", "array"]>;
|
|
46
|
-
properties: z.ZodRecord<z.ZodString, z.ZodEffects<z.ZodObject<{
|
|
47
|
-
type: z.ZodString;
|
|
48
|
-
format: z.ZodOptional<z.ZodEnum<["enum", "date-time"]>>;
|
|
49
|
-
pattern: z.ZodOptional<z.ZodString>;
|
|
50
|
-
}, "strip", z.ZodTypeAny, {
|
|
51
|
-
type?: string;
|
|
52
|
-
format?: "enum" | "date-time";
|
|
53
|
-
pattern?: string;
|
|
54
|
-
}, {
|
|
55
|
-
type?: string;
|
|
56
|
-
format?: "enum" | "date-time";
|
|
57
|
-
pattern?: string;
|
|
58
|
-
}>, {
|
|
59
|
-
type?: string;
|
|
60
|
-
format?: "enum" | "date-time";
|
|
61
|
-
pattern?: string;
|
|
62
|
-
}, {
|
|
63
|
-
type?: string;
|
|
64
|
-
format?: "enum" | "date-time";
|
|
65
|
-
pattern?: string;
|
|
66
|
-
}>>;
|
|
67
|
-
required: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
68
|
-
}, "strip", z.ZodTypeAny, {
|
|
69
|
-
type?: "object" | "array";
|
|
70
|
-
properties?: Record<string, {
|
|
71
|
-
type?: string;
|
|
72
|
-
format?: "enum" | "date-time";
|
|
73
|
-
pattern?: string;
|
|
74
|
-
}>;
|
|
75
|
-
required?: string[];
|
|
76
|
-
}, {
|
|
77
|
-
type?: "object" | "array";
|
|
78
|
-
properties?: Record<string, {
|
|
79
|
-
type?: string;
|
|
80
|
-
format?: "enum" | "date-time";
|
|
81
|
-
pattern?: string;
|
|
82
|
-
}>;
|
|
83
|
-
required?: string[];
|
|
84
|
-
}>;
|
|
85
|
-
requestStartMessage: z.ZodOptional<z.ZodString>;
|
|
86
|
-
operation: z.ZodObject<{
|
|
87
|
-
method: z.ZodDefault<z.ZodNativeEnum<typeof import("..").AllowedHttpMethod>>;
|
|
88
|
-
url: z.ZodString;
|
|
89
|
-
waitForResponse: z.ZodDefault<z.ZodBoolean>;
|
|
90
|
-
headers: z.ZodOptional<z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodString>, Record<string, string>, Record<string, string>>>;
|
|
91
|
-
}, "strip", z.ZodTypeAny, {
|
|
92
|
-
url?: string;
|
|
93
|
-
method?: import("..").AllowedHttpMethod;
|
|
94
|
-
headers?: Record<string, string>;
|
|
95
|
-
waitForResponse?: boolean;
|
|
96
|
-
}, {
|
|
97
|
-
url?: string;
|
|
98
|
-
method?: import("..").AllowedHttpMethod;
|
|
99
|
-
headers?: Record<string, string>;
|
|
100
|
-
waitForResponse?: boolean;
|
|
101
|
-
}>;
|
|
102
|
-
}, "strip", z.ZodTypeAny, {
|
|
103
|
-
name?: string;
|
|
104
|
-
description?: string;
|
|
105
|
-
parameters?: {
|
|
106
|
-
type?: "object" | "array";
|
|
107
|
-
properties?: Record<string, {
|
|
108
|
-
type?: string;
|
|
109
|
-
format?: "enum" | "date-time";
|
|
110
|
-
pattern?: string;
|
|
111
|
-
}>;
|
|
112
|
-
required?: string[];
|
|
113
|
-
};
|
|
114
|
-
requestStartMessage?: string;
|
|
115
|
-
operation?: {
|
|
116
|
-
url?: string;
|
|
117
|
-
method?: import("..").AllowedHttpMethod;
|
|
118
|
-
headers?: Record<string, string>;
|
|
119
|
-
waitForResponse?: boolean;
|
|
120
|
-
};
|
|
121
|
-
}, {
|
|
122
|
-
name?: string;
|
|
123
|
-
description?: string;
|
|
124
|
-
parameters?: {
|
|
125
|
-
type?: "object" | "array";
|
|
126
|
-
properties?: Record<string, {
|
|
127
|
-
type?: string;
|
|
128
|
-
format?: "enum" | "date-time";
|
|
129
|
-
pattern?: string;
|
|
130
|
-
}>;
|
|
131
|
-
required?: string[];
|
|
132
|
-
};
|
|
133
|
-
requestStartMessage?: string;
|
|
134
|
-
operation?: {
|
|
135
|
-
url?: string;
|
|
136
|
-
method?: import("..").AllowedHttpMethod;
|
|
137
|
-
headers?: Record<string, string>;
|
|
138
|
-
waitForResponse?: boolean;
|
|
139
|
-
};
|
|
140
|
-
}>, "many">>;
|
|
141
|
-
}, "strip", z.ZodTypeAny, {
|
|
142
|
-
provider?: LanguageModelProvider;
|
|
143
|
-
apiKey?: string;
|
|
144
|
-
model?: string;
|
|
145
|
-
temperature?: number;
|
|
146
|
-
maxTokens?: number;
|
|
147
|
-
baseUrl?: string;
|
|
148
|
-
knowledgeBase?: {
|
|
149
|
-
type?: "s3";
|
|
150
|
-
title?: string;
|
|
151
|
-
document?: string;
|
|
152
|
-
}[];
|
|
153
|
-
tools?: {
|
|
154
|
-
name?: string;
|
|
155
|
-
description?: string;
|
|
156
|
-
parameters?: {
|
|
157
|
-
type?: "object" | "array";
|
|
158
|
-
properties?: Record<string, {
|
|
159
|
-
type?: string;
|
|
160
|
-
format?: "enum" | "date-time";
|
|
161
|
-
pattern?: string;
|
|
162
|
-
}>;
|
|
163
|
-
required?: string[];
|
|
164
|
-
};
|
|
165
|
-
requestStartMessage?: string;
|
|
166
|
-
operation?: {
|
|
167
|
-
url?: string;
|
|
168
|
-
method?: import("..").AllowedHttpMethod;
|
|
169
|
-
headers?: Record<string, string>;
|
|
170
|
-
waitForResponse?: boolean;
|
|
171
|
-
};
|
|
172
|
-
}[];
|
|
173
|
-
}, {
|
|
174
|
-
provider?: LanguageModelProvider;
|
|
175
|
-
apiKey?: string;
|
|
176
|
-
model?: string;
|
|
177
|
-
temperature?: number;
|
|
178
|
-
maxTokens?: number;
|
|
179
|
-
baseUrl?: string;
|
|
180
|
-
knowledgeBase?: {
|
|
181
|
-
type?: "s3";
|
|
182
|
-
title?: string;
|
|
183
|
-
document?: string;
|
|
184
|
-
}[];
|
|
185
|
-
tools?: {
|
|
186
|
-
name?: string;
|
|
187
|
-
description?: string;
|
|
188
|
-
parameters?: {
|
|
189
|
-
type?: "object" | "array";
|
|
190
|
-
properties?: Record<string, {
|
|
191
|
-
type?: string;
|
|
192
|
-
format?: "enum" | "date-time";
|
|
193
|
-
pattern?: string;
|
|
194
|
-
}>;
|
|
195
|
-
required?: string[];
|
|
196
|
-
};
|
|
197
|
-
requestStartMessage?: string;
|
|
198
|
-
operation?: {
|
|
199
|
-
url?: string;
|
|
200
|
-
method?: import("..").AllowedHttpMethod;
|
|
201
|
-
headers?: Record<string, string>;
|
|
202
|
-
waitForResponse?: boolean;
|
|
203
|
-
};
|
|
204
|
-
}[];
|
|
205
|
-
}>;
|
|
206
|
-
export { languageModelConfigSchema };
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.languageModelConfigSchema = void 0;
|
|
37
|
-
/**
|
|
38
|
-
* Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
|
|
39
|
-
* http://github.com/fonoster/fonoster
|
|
40
|
-
*
|
|
41
|
-
* This file is part of Fonoster
|
|
42
|
-
*
|
|
43
|
-
* Licensed under the MIT License (the "License");
|
|
44
|
-
* you may not use this file except in compliance with
|
|
45
|
-
* the License. You may obtain a copy of the License at
|
|
46
|
-
*
|
|
47
|
-
* https://opensource.org/licenses/MIT
|
|
48
|
-
*
|
|
49
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
50
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
51
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
52
|
-
* See the License for the specific language governing permissions and
|
|
53
|
-
* limitations under the License.
|
|
54
|
-
*/
|
|
55
|
-
const zod_1 = require("zod");
|
|
56
|
-
const Messages = __importStar(require("../messages"));
|
|
57
|
-
const LanguageModelProvider_1 = require("./LanguageModelProvider");
|
|
58
|
-
const tools_1 = require("./tools");
|
|
59
|
-
const NUMBER_BETWEEN_0_AND_2 = "Must be a number between 0 and 2";
|
|
60
|
-
const languageModelConfigSchema = zod_1.z.object({
|
|
61
|
-
provider: zod_1.z.nativeEnum(LanguageModelProvider_1.LanguageModelProvider, {
|
|
62
|
-
message: "Invalid language model provider."
|
|
63
|
-
}),
|
|
64
|
-
apiKey: zod_1.z.string().optional(),
|
|
65
|
-
model: zod_1.z.string(),
|
|
66
|
-
temperature: zod_1.z
|
|
67
|
-
.number()
|
|
68
|
-
.max(2, { message: NUMBER_BETWEEN_0_AND_2 })
|
|
69
|
-
.min(0, { message: NUMBER_BETWEEN_0_AND_2 }),
|
|
70
|
-
maxTokens: zod_1.z
|
|
71
|
-
.number()
|
|
72
|
-
.int({ message: Messages.POSITIVE_INTEGER_MESSAGE })
|
|
73
|
-
.positive({ message: Messages.POSITIVE_INTEGER_MESSAGE }),
|
|
74
|
-
baseUrl: zod_1.z
|
|
75
|
-
.string()
|
|
76
|
-
.url({
|
|
77
|
-
message: Messages.VALID_URL
|
|
78
|
-
})
|
|
79
|
-
.optional(),
|
|
80
|
-
knowledgeBase: zod_1.z
|
|
81
|
-
.array(zod_1.z.object({
|
|
82
|
-
type: zod_1.z.enum(["s3"]),
|
|
83
|
-
title: zod_1.z.string(),
|
|
84
|
-
document: zod_1.z.string().regex(/\.pdf$/, {
|
|
85
|
-
message: "Document must be a pdf file"
|
|
86
|
-
})
|
|
87
|
-
}))
|
|
88
|
-
.default([]),
|
|
89
|
-
tools: zod_1.z.array(tools_1.toolSchema).default([])
|
|
90
|
-
});
|
|
91
|
-
exports.languageModelConfigSchema = languageModelConfigSchema;
|