@fonoster/autopilot 0.9.21 → 0.9.22
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/Autopilot.js +6 -2
- package/dist/assistants/index.d.ts +18 -0
- package/dist/assistants/index.js +1 -1
- package/dist/assistants/loadAndValidateAssistant.js +2 -2
- package/dist/assistants/types.d.ts +19 -1
- package/dist/envs.d.ts +5 -5
- package/dist/envs.js +5 -5
- package/dist/handleVoiceRequest.js +11 -10
- package/dist/index.d.ts +18 -0
- package/dist/index.js +1 -1
- package/dist/knowledge/AbstractKnowledgeBase.js +1 -1
- package/dist/knowledge/FilesKnowledgeBase.d.ts +18 -0
- package/dist/knowledge/FilesKnowledgeBase.js +1 -1
- package/dist/knowledge/S3KnowledgeBase.d.ts +18 -0
- package/dist/knowledge/S3KnowledgeBase.js +1 -1
- package/dist/knowledge/index.d.ts +18 -0
- package/dist/knowledge/index.js +1 -1
- package/dist/knowledge/types.d.ts +18 -0
- package/dist/loadAssistantConfigFromFile.js +2 -2
- package/dist/loadAssistantFromAPI.d.ts +18 -0
- package/dist/loadAssistantFromAPI.js +12 -9
- package/dist/machine/actions/announceIdleTimeout.js +1 -1
- package/dist/machine/actions/announceSystemError.js +1 -1
- package/dist/machine/actions/appendSpeech.d.ts +1 -1
- package/dist/machine/actions/appendSpeech.js +2 -2
- package/dist/machine/actions/cleanSpeech.d.ts +1 -1
- package/dist/machine/actions/cleanSpeech.js +1 -1
- package/dist/machine/actions/goodbye.js +1 -1
- package/dist/machine/actions/greetUser.js +1 -1
- package/dist/machine/actions/increaseIdleTimeoutCount.d.ts +1 -1
- package/dist/machine/actions/increaseIdleTimeoutCount.js +2 -2
- package/dist/machine/actions/index.d.ts +18 -0
- package/dist/machine/actions/index.js +1 -1
- package/dist/machine/actions/interruptPlayback.js +1 -1
- package/dist/machine/actions/resetIdleTimeoutCount.d.ts +1 -1
- package/dist/machine/actions/resetIdleTimeoutCount.js +2 -2
- package/dist/machine/actions/resetState.d.ts +1 -1
- package/dist/machine/actions/resetState.js +2 -2
- package/dist/machine/actions/setSpeaking.d.ts +1 -1
- package/dist/machine/actions/setSpeaking.js +2 -2
- package/dist/machine/actions/setSpeakingDone.d.ts +1 -1
- package/dist/machine/actions/setSpeakingDone.js +2 -2
- package/dist/machine/actors/doProcessUserRequest.js +2 -2
- package/dist/machine/actors/index.d.ts +18 -0
- package/dist/machine/actors/index.js +1 -1
- package/dist/machine/context.d.ts +18 -0
- package/dist/machine/context.js +1 -1
- package/dist/machine/delays.d.ts +18 -0
- package/dist/machine/delays.js +1 -2
- package/dist/machine/guards/hasSpeechResult.js +1 -1
- package/dist/machine/guards/idleTimeoutCountExceedsMax.js +1 -1
- package/dist/machine/guards/index.d.ts +18 -0
- package/dist/machine/guards/index.js +1 -1
- package/dist/machine/guards/isSpeaking.js +1 -1
- package/dist/machine/index.d.ts +18 -0
- package/dist/machine/index.js +1 -1
- package/dist/machine/machine.d.ts +38 -81
- package/dist/machine/machine.js +1 -2
- package/dist/machine/setup.d.ts +67 -83
- package/dist/machine/setup.js +57 -12
- package/dist/machine/types.d.ts +28 -1
- package/dist/models/AbstractLanguageModel.d.ts +1 -1
- package/dist/models/AbstractLanguageModel.js +3 -3
- package/dist/models/LanguageModelFactory.d.ts +2 -2
- package/dist/models/LanguageModelFactory.js +2 -2
- package/dist/models/chatHistory.js +1 -1
- package/dist/models/createChain.d.ts +19 -1
- package/dist/models/createLanguageModel.d.ts +18 -0
- package/dist/models/createLanguageModel.js +5 -6
- package/dist/models/createPromptTemplate.d.ts +18 -0
- package/dist/models/createPromptTemplate.js +1 -1
- package/dist/models/evaluations/createTestTextSimilarity.js +1 -1
- package/dist/models/evaluations/evalTestCases.d.ts +24 -2
- package/dist/models/evaluations/evalTestCases.js +3 -3
- package/dist/models/evaluations/evaluateScenario.js +18 -0
- package/dist/models/evaluations/evaluateStep.js +21 -3
- package/dist/models/evaluations/evaluateTextResponse.d.ts +18 -0
- package/dist/models/evaluations/evaluateTextResponse.js +1 -1
- package/dist/models/evaluations/evaluateToolCalls.js +18 -0
- package/dist/models/evaluations/index.d.ts +18 -0
- package/dist/models/evaluations/index.js +1 -1
- package/dist/models/evaluations/printEval.js +2 -2
- package/dist/models/evaluations/textSimilaryPrompt.d.ts +18 -0
- package/dist/models/evaluations/textSimilaryPrompt.js +1 -1
- package/dist/models/evaluations/types.d.ts +19 -6
- package/dist/models/groq/Groq.d.ts +1 -1
- package/dist/models/groq/index.d.ts +18 -0
- package/dist/models/groq/index.js +2 -2
- package/dist/models/groq/types.d.ts +18 -0
- package/dist/models/index.d.ts +18 -0
- package/dist/models/index.js +2 -2
- package/dist/models/ollama/Ollama.d.ts +1 -1
- package/dist/models/ollama/index.d.ts +18 -0
- package/dist/models/ollama/index.js +1 -1
- package/dist/models/ollama/types.d.ts +18 -0
- package/dist/models/openai/OpenAI.d.ts +1 -1
- package/dist/models/openai/index.d.ts +18 -0
- package/dist/models/openai/index.js +2 -2
- package/dist/models/openai/types.d.ts +18 -0
- package/dist/models/toolInvocation.d.ts +1 -1
- package/dist/models/toolInvocation.js +1 -1
- package/dist/models/types.d.ts +19 -1
- package/dist/sendConversationEndedEvent.d.ts +19 -2
- package/dist/sendConversationEndedEvent.js +1 -1
- package/dist/server.js +163 -1
- package/dist/tools/ToolsCatalog.d.ts +1 -1
- package/dist/tools/ToolsCatalog.js +6 -6
- package/dist/tools/builtin/hangupToolDefinition.d.ts +19 -1
- package/dist/tools/builtin/transferToolDefinition.d.ts +19 -1
- package/dist/tools/convertToolToOpenAITool.d.ts +19 -1
- package/dist/tools/index.d.ts +18 -0
- package/dist/tools/index.js +1 -1
- package/dist/tools/types.d.ts +27 -0
- package/dist/types.d.ts +27 -2
- package/dist/vad/SileroVad.js +1 -2
- package/dist/vad/SileroVadModel.js +1 -1
- package/dist/vad/chunkToFloat32Array.d.ts +18 -0
- package/dist/vad/chunkToFloat32Array.js +1 -5
- package/dist/vad/createVad.js +1 -10
- package/dist/vad/index.d.ts +18 -0
- package/dist/vad/index.js +1 -2
- package/dist/vad/types.d.ts +18 -0
- package/dist/vadWorker.js +3 -3
- package/dist/vadv5/SileroVad.js +1 -2
- package/dist/vadv5/SileroVadModel.js +1 -1
- package/dist/vadv5/createVad.js +3 -4
- package/dist/vadv5/index.d.ts +18 -0
- package/dist/vadv5/index.js +1 -2
- package/dist/vadv5/types.d.ts +18 -0
- package/dist/voice/Voice.js +1 -1
- package/dist/voice/index.d.ts +18 -0
- package/dist/voice/index.js +2 -2
- package/dist/voice/types.d.ts +18 -0
- package/dist/voiceServerSetup.js +1 -1
- package/package.json +9 -11
- package/dist/tools/type.d.ts +0 -9
- /package/dist/tools/{type.js → types.js} +0 -0
|
@@ -1,2 +1,20 @@
|
|
|
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
|
+
*/
|
|
1
19
|
export * from "./Groq";
|
|
2
20
|
export * from "./types";
|
|
@@ -14,8 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
|
|
18
|
-
/*
|
|
17
|
+
/**
|
|
19
18
|
* Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
|
|
20
19
|
* http://github.com/fonoster/fonoster
|
|
21
20
|
*
|
|
@@ -33,4 +32,5 @@ __exportStar(require("./Groq"), exports);
|
|
|
33
32
|
* See the License for the specific language governing permissions and
|
|
34
33
|
* limitations under the License.
|
|
35
34
|
*/
|
|
35
|
+
__exportStar(require("./Groq"), exports);
|
|
36
36
|
__exportStar(require("./types"), exports);
|
|
@@ -1,3 +1,21 @@
|
|
|
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
|
+
*/
|
|
1
19
|
import { BaseModelParams } from "../types";
|
|
2
20
|
declare enum GroqModel {
|
|
3
21
|
LLAMA3_1_8B_INSTANT = "llama-3.1-8b-instant",
|
package/dist/models/index.d.ts
CHANGED
|
@@ -1,3 +1,21 @@
|
|
|
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
|
+
*/
|
|
1
19
|
export * from "./LanguageModelFactory";
|
|
2
20
|
export * from "./types";
|
|
3
21
|
export * from "./evaluations";
|
package/dist/models/index.js
CHANGED
|
@@ -14,8 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
|
|
18
|
-
/*
|
|
17
|
+
/**
|
|
19
18
|
* Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
|
|
20
19
|
* http://github.com/fonoster/fonoster
|
|
21
20
|
*
|
|
@@ -33,5 +32,6 @@ __exportStar(require("./LanguageModelFactory"), exports);
|
|
|
33
32
|
* See the License for the specific language governing permissions and
|
|
34
33
|
* limitations under the License.
|
|
35
34
|
*/
|
|
35
|
+
__exportStar(require("./LanguageModelFactory"), exports);
|
|
36
36
|
__exportStar(require("./types"), exports);
|
|
37
37
|
__exportStar(require("./evaluations"), exports);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { OllamaParams } from "./types";
|
|
2
1
|
import { Voice } from "../../voice";
|
|
3
2
|
import { AbstractLanguageModel } from "../AbstractLanguageModel";
|
|
4
3
|
import { TelephonyContext } from "../types";
|
|
4
|
+
import { OllamaParams } from "./types";
|
|
5
5
|
declare const LANGUAGE_MODEL_NAME = "llm.ollama";
|
|
6
6
|
declare class Ollama extends AbstractLanguageModel {
|
|
7
7
|
constructor(params: OllamaParams, voice: Voice, telephonyContext: TelephonyContext);
|
|
@@ -1,2 +1,20 @@
|
|
|
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
|
+
*/
|
|
1
19
|
export * from "./Ollama";
|
|
2
20
|
export * from "./types";
|
|
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
|
|
17
|
+
/**
|
|
18
18
|
* Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
|
|
19
19
|
* http://github.com/fonoster/fonoster
|
|
20
20
|
*
|
|
@@ -1,3 +1,21 @@
|
|
|
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
|
+
*/
|
|
1
19
|
import { BaseModelParams } from "../types";
|
|
2
20
|
declare enum OllamaModel {
|
|
3
21
|
LLAMA_3_GROQ_TOOL_USE = "llama3-groq-tool-use"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { OpenAIParams } from "./types";
|
|
2
1
|
import { Voice } from "../../voice";
|
|
3
2
|
import { AbstractLanguageModel } from "../AbstractLanguageModel";
|
|
4
3
|
import { TelephonyContext } from "../types";
|
|
4
|
+
import { OpenAIParams } from "./types";
|
|
5
5
|
declare const LANGUAGE_MODEL_NAME = "llm.openai";
|
|
6
6
|
declare class OpenAI extends AbstractLanguageModel {
|
|
7
7
|
constructor(params: OpenAIParams, voice: Voice, telephonyContext: TelephonyContext);
|
|
@@ -1,2 +1,20 @@
|
|
|
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
|
+
*/
|
|
1
19
|
export * from "./OpenAI";
|
|
2
20
|
export * from "./types";
|
|
@@ -14,8 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
|
|
18
|
-
/*
|
|
17
|
+
/**
|
|
19
18
|
* Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
|
|
20
19
|
* http://github.com/fonoster/fonoster
|
|
21
20
|
*
|
|
@@ -33,4 +32,5 @@ __exportStar(require("./OpenAI"), exports);
|
|
|
33
32
|
* See the License for the specific language governing permissions and
|
|
34
33
|
* limitations under the License.
|
|
35
34
|
*/
|
|
35
|
+
__exportStar(require("./OpenAI"), exports);
|
|
36
36
|
__exportStar(require("./types"), exports);
|
|
@@ -1,3 +1,21 @@
|
|
|
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
|
+
*/
|
|
1
19
|
import { BaseModelParams } from "../types";
|
|
2
20
|
declare enum OpenAIModel {
|
|
3
21
|
GPT_4O = "gpt-4o",
|
package/dist/models/types.d.ts
CHANGED
|
@@ -1,8 +1,26 @@
|
|
|
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
|
+
*/
|
|
1
19
|
import { CallDirection } from "@fonoster/types";
|
|
2
20
|
import { BaseChatModel } from "@langchain/core/language_models/chat_models";
|
|
3
|
-
import { Tool } from "../tools/type";
|
|
4
21
|
import { ToolCall } from "@langchain/core/messages/tool";
|
|
5
22
|
import { KnowledgeBase } from "../knowledge";
|
|
23
|
+
import { Tool } from "../tools/types";
|
|
6
24
|
type LanguageModel = {
|
|
7
25
|
invoke: (text: string) => Promise<InvocationResult>;
|
|
8
26
|
};
|
|
@@ -1,8 +1,25 @@
|
|
|
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
|
+
*/
|
|
1
19
|
import { EventsHookAllowedEvents } from "@fonoster/common";
|
|
2
|
-
type EventsHook = {
|
|
20
|
+
export type EventsHook = {
|
|
3
21
|
url: string;
|
|
4
22
|
events: EventsHookAllowedEvents[];
|
|
5
23
|
headers?: Record<string, string>;
|
|
6
24
|
};
|
|
7
25
|
export declare function sendConversationEndedEvent(eventsHook: EventsHook, chatHistory: Record<string, string>[]): Promise<void>;
|
|
8
|
-
export {};
|
package/dist/server.js
CHANGED
|
@@ -1,7 +1,169 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
"use strict";
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
|
|
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
|
+
/**
|
|
23
|
+
* Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
|
|
24
|
+
* http://github.com/fonoster/fonoster
|
|
25
|
+
*
|
|
26
|
+
* This file is part of Fonoster
|
|
27
|
+
*
|
|
28
|
+
* Licensed under the MIT License (the "License");
|
|
29
|
+
* you may not use this file except in compliance with
|
|
30
|
+
* the License. You may obtain a copy of the License at
|
|
31
|
+
*
|
|
32
|
+
* https://opensource.org/licenses/MIT
|
|
33
|
+
*
|
|
34
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
35
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
36
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
37
|
+
* See the License for the specific language governing permissions and
|
|
38
|
+
* limitations under the License.
|
|
39
|
+
*/
|
|
40
|
+
/**
|
|
41
|
+
* Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
|
|
42
|
+
* http://github.com/fonoster/fonoster
|
|
43
|
+
*
|
|
44
|
+
* This file is part of Fonoster
|
|
45
|
+
*
|
|
46
|
+
* Licensed under the MIT License (the "License");
|
|
47
|
+
* you may not use this file except in compliance with
|
|
48
|
+
* the License. You may obtain a copy of the License at
|
|
49
|
+
*
|
|
50
|
+
* https://opensource.org/licenses/MIT
|
|
51
|
+
*
|
|
52
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
53
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
54
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
55
|
+
* See the License for the specific language governing permissions and
|
|
56
|
+
* limitations under the License.
|
|
57
|
+
*/
|
|
58
|
+
/**
|
|
59
|
+
* Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
|
|
60
|
+
* http://github.com/fonoster/fonoster
|
|
61
|
+
*
|
|
62
|
+
* This file is part of Fonoster
|
|
63
|
+
*
|
|
64
|
+
* Licensed under the MIT License (the "License");
|
|
65
|
+
* you may not use this file except in compliance with
|
|
66
|
+
* the License. You may obtain a copy of the License at
|
|
67
|
+
*
|
|
68
|
+
* https://opensource.org/licenses/MIT
|
|
69
|
+
*
|
|
70
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
71
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
72
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
73
|
+
* See the License for the specific language governing permissions and
|
|
74
|
+
* limitations under the License.
|
|
75
|
+
*/
|
|
76
|
+
/**
|
|
77
|
+
* Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
|
|
78
|
+
* http://github.com/fonoster/fonoster
|
|
79
|
+
*
|
|
80
|
+
* This file is part of Fonoster
|
|
81
|
+
*
|
|
82
|
+
* Licensed under the MIT License (the "License");
|
|
83
|
+
* you may not use this file except in compliance with
|
|
84
|
+
* the License. You may obtain a copy of the License at
|
|
85
|
+
*
|
|
86
|
+
* https://opensource.org/licenses/MIT
|
|
87
|
+
*
|
|
88
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
89
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
90
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
91
|
+
* See the License for the specific language governing permissions and
|
|
92
|
+
* limitations under the License.
|
|
93
|
+
*/
|
|
94
|
+
/**
|
|
95
|
+
* Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
|
|
96
|
+
* http://github.com/fonoster/fonoster
|
|
97
|
+
*
|
|
98
|
+
* This file is part of Fonoster
|
|
99
|
+
*
|
|
100
|
+
* Licensed under the MIT License (the "License");
|
|
101
|
+
* you may not use this file except in compliance with
|
|
102
|
+
* the License. You may obtain a copy of the License at
|
|
103
|
+
*
|
|
104
|
+
* https://opensource.org/licenses/MIT
|
|
105
|
+
*
|
|
106
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
107
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
108
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
109
|
+
* See the License for the specific language governing permissions and
|
|
110
|
+
* limitations under the License.
|
|
111
|
+
*/
|
|
112
|
+
/**
|
|
113
|
+
* Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
|
|
114
|
+
* http://github.com/fonoster/fonoster
|
|
115
|
+
*
|
|
116
|
+
* This file is part of Fonoster
|
|
117
|
+
*
|
|
118
|
+
* Licensed under the MIT License (the "License");
|
|
119
|
+
* you may not use this file except in compliance with
|
|
120
|
+
* the License. You may obtain a copy of the License at
|
|
121
|
+
*
|
|
122
|
+
* https://opensource.org/licenses/MIT
|
|
123
|
+
*
|
|
124
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
125
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
126
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
127
|
+
* See the License for the specific language governing permissions and
|
|
128
|
+
* limitations under the License.
|
|
129
|
+
*/
|
|
130
|
+
/**
|
|
131
|
+
* Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
|
|
132
|
+
* http://github.com/fonoster/fonoster
|
|
133
|
+
*
|
|
134
|
+
* This file is part of Fonoster
|
|
135
|
+
*
|
|
136
|
+
* Licensed under the MIT License (the "License");
|
|
137
|
+
* you may not use this file except in compliance with
|
|
138
|
+
* the License. You may obtain a copy of the License at
|
|
139
|
+
*
|
|
140
|
+
* https://opensource.org/licenses/MIT
|
|
141
|
+
*
|
|
142
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
143
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
144
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
145
|
+
* See the License for the specific language governing permissions and
|
|
146
|
+
* limitations under the License.
|
|
147
|
+
*/
|
|
148
|
+
/**
|
|
149
|
+
* Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
|
|
150
|
+
* http://github.com/fonoster/fonoster
|
|
151
|
+
*
|
|
152
|
+
* This file is part of Fonoster
|
|
153
|
+
*
|
|
154
|
+
* Licensed under the MIT License (the "License");
|
|
155
|
+
* you may not use this file except in compliance with
|
|
156
|
+
* the License. You may obtain a copy of the License at
|
|
157
|
+
*
|
|
158
|
+
* https://opensource.org/licenses/MIT
|
|
159
|
+
*
|
|
160
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
161
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
162
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
163
|
+
* See the License for the specific language governing permissions and
|
|
164
|
+
* limitations under the License.
|
|
165
|
+
*/
|
|
166
|
+
/**
|
|
5
167
|
* Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
|
|
6
168
|
* http://github.com/fonoster/fonoster
|
|
7
169
|
*
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ToolsCatalog = void 0;
|
|
4
|
-
|
|
4
|
+
/**
|
|
5
5
|
* Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
|
|
6
6
|
* http://github.com/fonoster/fonoster
|
|
7
7
|
*
|
|
@@ -19,8 +19,8 @@ exports.ToolsCatalog = void 0;
|
|
|
19
19
|
* See the License for the specific language governing permissions and
|
|
20
20
|
* limitations under the License.
|
|
21
21
|
*/
|
|
22
|
-
const logger_1 = require("@fonoster/logger");
|
|
23
22
|
const common_1 = require("@fonoster/common");
|
|
23
|
+
const logger_1 = require("@fonoster/logger");
|
|
24
24
|
const logger = (0, logger_1.getLogger)({ service: "autopilot", filePath: __filename });
|
|
25
25
|
class ToolsCatalog {
|
|
26
26
|
constructor(tools) {
|
|
@@ -38,10 +38,10 @@ class ToolsCatalog {
|
|
|
38
38
|
const parsedTool = common_1.toolSchema.parse(tool);
|
|
39
39
|
// FIXME: We shouldn't have to check the nullability of the operation
|
|
40
40
|
return await (0, common_1.sendHttpRequest)({
|
|
41
|
-
method: parsedTool.operation?.method,
|
|
42
|
-
url: parsedTool.operation?.url,
|
|
43
|
-
waitForResponse: parsedTool.operation?.waitForResponse,
|
|
44
|
-
headers: parsedTool.operation?.headers,
|
|
41
|
+
method: parsedTool.operation?.method ?? common_1.AllowedHttpMethod.GET,
|
|
42
|
+
url: parsedTool.operation?.url ?? "",
|
|
43
|
+
waitForResponse: parsedTool.operation?.waitForResponse ?? true,
|
|
44
|
+
headers: parsedTool.operation?.headers ?? {},
|
|
45
45
|
body: args
|
|
46
46
|
});
|
|
47
47
|
}
|
|
@@ -1,3 +1,21 @@
|
|
|
1
|
-
|
|
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 { BuiltInTool } from "../types";
|
|
2
20
|
declare const hangupToolDefinition: BuiltInTool;
|
|
3
21
|
export { hangupToolDefinition };
|
|
@@ -1,3 +1,21 @@
|
|
|
1
|
-
|
|
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 { BuiltInTool } from "../types";
|
|
2
20
|
declare const transferToolDefinition: BuiltInTool;
|
|
3
21
|
export { transferToolDefinition };
|
|
@@ -1,3 +1,21 @@
|
|
|
1
|
-
|
|
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 { OpenAITool, Tool } from "./types";
|
|
2
20
|
declare function convertToolToOpenAITool(tool: Tool): OpenAITool;
|
|
3
21
|
export { convertToolToOpenAITool };
|
package/dist/tools/index.d.ts
CHANGED
|
@@ -1,3 +1,21 @@
|
|
|
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
|
+
*/
|
|
1
19
|
export * from "./ToolsCatalog";
|
|
2
20
|
export * from "./builtin/hangupToolDefinition";
|
|
3
21
|
export * from "./builtin/transferToolDefinition";
|
package/dist/tools/index.js
CHANGED
|
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
|
|
17
|
+
/**
|
|
18
18
|
* Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
|
|
19
19
|
* http://github.com/fonoster/fonoster
|
|
20
20
|
*
|