@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.
Files changed (137) hide show
  1. package/dist/Autopilot.js +6 -2
  2. package/dist/assistants/index.d.ts +18 -0
  3. package/dist/assistants/index.js +1 -1
  4. package/dist/assistants/loadAndValidateAssistant.js +2 -2
  5. package/dist/assistants/types.d.ts +19 -1
  6. package/dist/envs.d.ts +5 -5
  7. package/dist/envs.js +5 -5
  8. package/dist/handleVoiceRequest.js +11 -10
  9. package/dist/index.d.ts +18 -0
  10. package/dist/index.js +1 -1
  11. package/dist/knowledge/AbstractKnowledgeBase.js +1 -1
  12. package/dist/knowledge/FilesKnowledgeBase.d.ts +18 -0
  13. package/dist/knowledge/FilesKnowledgeBase.js +1 -1
  14. package/dist/knowledge/S3KnowledgeBase.d.ts +18 -0
  15. package/dist/knowledge/S3KnowledgeBase.js +1 -1
  16. package/dist/knowledge/index.d.ts +18 -0
  17. package/dist/knowledge/index.js +1 -1
  18. package/dist/knowledge/types.d.ts +18 -0
  19. package/dist/loadAssistantConfigFromFile.js +2 -2
  20. package/dist/loadAssistantFromAPI.d.ts +18 -0
  21. package/dist/loadAssistantFromAPI.js +12 -9
  22. package/dist/machine/actions/announceIdleTimeout.js +1 -1
  23. package/dist/machine/actions/announceSystemError.js +1 -1
  24. package/dist/machine/actions/appendSpeech.d.ts +1 -1
  25. package/dist/machine/actions/appendSpeech.js +2 -2
  26. package/dist/machine/actions/cleanSpeech.d.ts +1 -1
  27. package/dist/machine/actions/cleanSpeech.js +1 -1
  28. package/dist/machine/actions/goodbye.js +1 -1
  29. package/dist/machine/actions/greetUser.js +1 -1
  30. package/dist/machine/actions/increaseIdleTimeoutCount.d.ts +1 -1
  31. package/dist/machine/actions/increaseIdleTimeoutCount.js +2 -2
  32. package/dist/machine/actions/index.d.ts +18 -0
  33. package/dist/machine/actions/index.js +1 -1
  34. package/dist/machine/actions/interruptPlayback.js +1 -1
  35. package/dist/machine/actions/resetIdleTimeoutCount.d.ts +1 -1
  36. package/dist/machine/actions/resetIdleTimeoutCount.js +2 -2
  37. package/dist/machine/actions/resetState.d.ts +1 -1
  38. package/dist/machine/actions/resetState.js +2 -2
  39. package/dist/machine/actions/setSpeaking.d.ts +1 -1
  40. package/dist/machine/actions/setSpeaking.js +2 -2
  41. package/dist/machine/actions/setSpeakingDone.d.ts +1 -1
  42. package/dist/machine/actions/setSpeakingDone.js +2 -2
  43. package/dist/machine/actors/doProcessUserRequest.js +2 -2
  44. package/dist/machine/actors/index.d.ts +18 -0
  45. package/dist/machine/actors/index.js +1 -1
  46. package/dist/machine/context.d.ts +18 -0
  47. package/dist/machine/context.js +1 -1
  48. package/dist/machine/delays.d.ts +18 -0
  49. package/dist/machine/delays.js +1 -2
  50. package/dist/machine/guards/hasSpeechResult.js +1 -1
  51. package/dist/machine/guards/idleTimeoutCountExceedsMax.js +1 -1
  52. package/dist/machine/guards/index.d.ts +18 -0
  53. package/dist/machine/guards/index.js +1 -1
  54. package/dist/machine/guards/isSpeaking.js +1 -1
  55. package/dist/machine/index.d.ts +18 -0
  56. package/dist/machine/index.js +1 -1
  57. package/dist/machine/machine.d.ts +38 -81
  58. package/dist/machine/machine.js +1 -2
  59. package/dist/machine/setup.d.ts +67 -83
  60. package/dist/machine/setup.js +57 -12
  61. package/dist/machine/types.d.ts +28 -1
  62. package/dist/models/AbstractLanguageModel.d.ts +1 -1
  63. package/dist/models/AbstractLanguageModel.js +3 -3
  64. package/dist/models/LanguageModelFactory.d.ts +2 -2
  65. package/dist/models/LanguageModelFactory.js +2 -2
  66. package/dist/models/chatHistory.js +1 -1
  67. package/dist/models/createChain.d.ts +19 -1
  68. package/dist/models/createLanguageModel.d.ts +18 -0
  69. package/dist/models/createLanguageModel.js +5 -6
  70. package/dist/models/createPromptTemplate.d.ts +18 -0
  71. package/dist/models/createPromptTemplate.js +1 -1
  72. package/dist/models/evaluations/createTestTextSimilarity.js +1 -1
  73. package/dist/models/evaluations/evalTestCases.d.ts +24 -2
  74. package/dist/models/evaluations/evalTestCases.js +3 -3
  75. package/dist/models/evaluations/evaluateScenario.js +18 -0
  76. package/dist/models/evaluations/evaluateStep.js +21 -3
  77. package/dist/models/evaluations/evaluateTextResponse.d.ts +18 -0
  78. package/dist/models/evaluations/evaluateTextResponse.js +1 -1
  79. package/dist/models/evaluations/evaluateToolCalls.js +18 -0
  80. package/dist/models/evaluations/index.d.ts +18 -0
  81. package/dist/models/evaluations/index.js +1 -1
  82. package/dist/models/evaluations/printEval.js +2 -2
  83. package/dist/models/evaluations/textSimilaryPrompt.d.ts +18 -0
  84. package/dist/models/evaluations/textSimilaryPrompt.js +1 -1
  85. package/dist/models/evaluations/types.d.ts +19 -6
  86. package/dist/models/groq/Groq.d.ts +1 -1
  87. package/dist/models/groq/index.d.ts +18 -0
  88. package/dist/models/groq/index.js +2 -2
  89. package/dist/models/groq/types.d.ts +18 -0
  90. package/dist/models/index.d.ts +18 -0
  91. package/dist/models/index.js +2 -2
  92. package/dist/models/ollama/Ollama.d.ts +1 -1
  93. package/dist/models/ollama/index.d.ts +18 -0
  94. package/dist/models/ollama/index.js +1 -1
  95. package/dist/models/ollama/types.d.ts +18 -0
  96. package/dist/models/openai/OpenAI.d.ts +1 -1
  97. package/dist/models/openai/index.d.ts +18 -0
  98. package/dist/models/openai/index.js +2 -2
  99. package/dist/models/openai/types.d.ts +18 -0
  100. package/dist/models/toolInvocation.d.ts +1 -1
  101. package/dist/models/toolInvocation.js +1 -1
  102. package/dist/models/types.d.ts +19 -1
  103. package/dist/sendConversationEndedEvent.d.ts +19 -2
  104. package/dist/sendConversationEndedEvent.js +1 -1
  105. package/dist/server.js +163 -1
  106. package/dist/tools/ToolsCatalog.d.ts +1 -1
  107. package/dist/tools/ToolsCatalog.js +6 -6
  108. package/dist/tools/builtin/hangupToolDefinition.d.ts +19 -1
  109. package/dist/tools/builtin/transferToolDefinition.d.ts +19 -1
  110. package/dist/tools/convertToolToOpenAITool.d.ts +19 -1
  111. package/dist/tools/index.d.ts +18 -0
  112. package/dist/tools/index.js +1 -1
  113. package/dist/tools/types.d.ts +27 -0
  114. package/dist/types.d.ts +27 -2
  115. package/dist/vad/SileroVad.js +1 -2
  116. package/dist/vad/SileroVadModel.js +1 -1
  117. package/dist/vad/chunkToFloat32Array.d.ts +18 -0
  118. package/dist/vad/chunkToFloat32Array.js +1 -5
  119. package/dist/vad/createVad.js +1 -10
  120. package/dist/vad/index.d.ts +18 -0
  121. package/dist/vad/index.js +1 -2
  122. package/dist/vad/types.d.ts +18 -0
  123. package/dist/vadWorker.js +3 -3
  124. package/dist/vadv5/SileroVad.js +1 -2
  125. package/dist/vadv5/SileroVadModel.js +1 -1
  126. package/dist/vadv5/createVad.js +3 -4
  127. package/dist/vadv5/index.d.ts +18 -0
  128. package/dist/vadv5/index.js +1 -2
  129. package/dist/vadv5/types.d.ts +18 -0
  130. package/dist/voice/Voice.js +1 -1
  131. package/dist/voice/index.d.ts +18 -0
  132. package/dist/voice/index.js +2 -2
  133. package/dist/voice/types.d.ts +18 -0
  134. package/dist/voiceServerSetup.js +1 -1
  135. package/package.json +9 -11
  136. package/dist/tools/type.d.ts +0 -9
  137. /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
- __exportStar(require("./Groq"), exports);
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",
@@ -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";
@@ -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
- __exportStar(require("./LanguageModelFactory"), exports);
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
- __exportStar(require("./OpenAI"), exports);
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",
@@ -1,5 +1,5 @@
1
- import { createChatHistory } from "./chatHistory";
2
1
  import { ToolsCatalog } from "../tools";
2
+ import { createChatHistory } from "./chatHistory";
3
3
  declare function toolInvocation(params: {
4
4
  toolName: string;
5
5
  chatHistory: ReturnType<typeof createChatHistory>;
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.toolInvocation = toolInvocation;
4
- /*
4
+ /**
5
5
  * Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
6
6
  * http://github.com/fonoster/fonoster
7
7
  *
@@ -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 {};
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.sendConversationEndedEvent = sendConversationEndedEvent;
4
- /*
4
+ /**
5
5
  * Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
6
6
  * http://github.com/fonoster/fonoster
7
7
  *
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,4 +1,4 @@
1
- import { Tool } from "./type";
1
+ import { Tool } from "./types";
2
2
  declare class ToolsCatalog {
3
3
  private readonly tools;
4
4
  constructor(tools: Tool[]);
@@ -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
- import { BuiltInTool } from "../type";
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
- import { BuiltInTool } from "../type";
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
- import { OpenAITool, Tool } from "./type";
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 };
@@ -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";
@@ -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
  *