@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,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.resetState = 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.resetState = void 0;
19
19
  * See the License for the specific language governing permissions and
20
20
  * limitations under the License.
21
21
  */
22
- const xstate_1 = require("xstate");
23
22
  const logger_1 = require("@fonoster/logger");
23
+ const xstate_1 = require("xstate");
24
24
  const logger = (0, logger_1.getLogger)({ service: "autopilot", filePath: __filename });
25
25
  exports.resetState = (0, xstate_1.assign)(({ context }) => {
26
26
  logger.verbose("called the resetState action");
@@ -1 +1 @@
1
- export declare const setSpeaking: import("xstate").ActionFunction<import("xstate").MachineContext, import("xstate").AnyEventObject, import("xstate").EventObject, import("xstate").NonReducibleUnknown, import("xstate").ProvidedActor, never, never, never, never>;
1
+ export declare const setSpeaking: import("xstate").ActionFunction<import("xstate").MachineContext, import("xstate").AnyEventObject, import("xstate").EventObject, {}, import("xstate").ProvidedActor, never, never, never, never>;
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.setSpeaking = 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.setSpeaking = void 0;
19
19
  * See the License for the specific language governing permissions and
20
20
  * limitations under the License.
21
21
  */
22
- const xstate_1 = require("xstate");
23
22
  const logger_1 = require("@fonoster/logger");
23
+ const xstate_1 = require("xstate");
24
24
  const logger = (0, logger_1.getLogger)({ service: "autopilot", filePath: __filename });
25
25
  exports.setSpeaking = (0, xstate_1.assign)(({ context }) => {
26
26
  logger.verbose("called the setSpeaking action", { isSpeaking: true });
@@ -1 +1 @@
1
- export declare const setSpeakingDone: import("xstate").ActionFunction<import("xstate").MachineContext, import("xstate").AnyEventObject, import("xstate").EventObject, import("xstate").NonReducibleUnknown, import("xstate").ProvidedActor, never, never, never, never>;
1
+ export declare const setSpeakingDone: import("xstate").ActionFunction<import("xstate").MachineContext, import("xstate").AnyEventObject, import("xstate").EventObject, {}, import("xstate").ProvidedActor, never, never, never, never>;
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.setSpeakingDone = 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.setSpeakingDone = void 0;
19
19
  * See the License for the specific language governing permissions and
20
20
  * limitations under the License.
21
21
  */
22
- const xstate_1 = require("xstate");
23
22
  const logger_1 = require("@fonoster/logger");
23
+ const xstate_1 = require("xstate");
24
24
  const logger = (0, logger_1.getLogger)({ service: "autopilot", filePath: __filename });
25
25
  exports.setSpeakingDone = (0, xstate_1.assign)(({ context }) => {
26
26
  logger.verbose("called the setSpeakingDone action", { isSpeaking: false });
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.doProcessUserRequest = 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.doProcessUserRequest = void 0;
19
19
  * See the License for the specific language governing permissions and
20
20
  * limitations under the License.
21
21
  */
22
- const xstate_1 = require("xstate");
23
22
  const logger_1 = require("@fonoster/logger");
23
+ const xstate_1 = require("xstate");
24
24
  const logger = (0, logger_1.getLogger)({ service: "autopilot", filePath: __filename });
25
25
  exports.doProcessUserRequest = (0, xstate_1.fromPromise)(async ({ input }) => {
26
26
  const { context } = input;
@@ -1 +1,19 @@
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 "./doProcessUserRequest";
@@ -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
  declare const context: ({ input }: {
2
20
  input: any;
3
21
  }) => {
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.context = void 0;
4
- /*
4
+ /**
5
5
  * Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
6
6
  * http://github.com/fonoster/fonoster
7
7
  *
@@ -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
  declare const delays: {
2
20
  IDLE_TIMEOUT: ({ context }: {
3
21
  context: any;
@@ -1,8 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.default = void 0;
4
- // @ts-nocheck - All inputs are validated by the APIServer
5
- /*
4
+ /**
6
5
  * Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
7
6
  * http://github.com/fonoster/fonoster
8
7
  *
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.hasSpeechResult = void 0;
4
- /*
4
+ /**
5
5
  * Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
6
6
  * http://github.com/fonoster/fonoster
7
7
  *
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.idleTimeoutCountExceedsMax = void 0;
4
- /*
4
+ /**
5
5
  * Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
6
6
  * http://github.com/fonoster/fonoster
7
7
  *
@@ -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 { idleTimeoutCountExceedsMax } from "./idleTimeoutCountExceedsMax";
2
20
  export { hasSpeechResult } from "./hasSpeechResult";
3
21
  export { isSpeaking } from "./isSpeaking";
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.isSpeaking = exports.hasSpeechResult = exports.idleTimeoutCountExceedsMax = void 0;
4
- /*
4
+ /**
5
5
  * Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
6
6
  * http://github.com/fonoster/fonoster
7
7
  *
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.isSpeaking = void 0;
4
- /*
4
+ /**
5
5
  * Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
6
6
  * http://github.com/fonoster/fonoster
7
7
  *
@@ -1 +1,19 @@
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 { machine } from "./machine";
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.machine = void 0;
4
- /*
4
+ /**
5
5
  * Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
6
6
  * http://github.com/fonoster/fonoster
7
7
  *
@@ -1,30 +1,50 @@
1
- declare const machine: import("xstate").StateMachine<any, {
2
- type: "SPEECH_START";
3
- } | {
4
- type: "SPEECH_END";
5
- } | {
6
- type: "SPEECH_RESULT";
7
- speech: string;
8
- responseTime: number;
9
- }, {
1
+ declare const machine: import("xstate").StateMachine<any, import("./types").AutopilotEvents, {
10
2
  [x: string]: import("xstate").ActorRefFromLogic<import("xstate").PromiseActorLogic<void, {
11
3
  context: import("./types").AutopilotContext;
12
- }, import("xstate").EventObject>> | undefined;
4
+ }, import("xstate").EventObject>>;
13
5
  }, {
14
6
  src: "doProcessUserRequest";
15
7
  logic: import("xstate").PromiseActorLogic<void, {
16
8
  context: import("./types").AutopilotContext;
17
9
  }, import("xstate").EventObject>;
18
- id: string | undefined;
10
+ id: string;
19
11
  }, import("xstate").Values<{
20
- goodbye: {
21
- type: "goodbye";
12
+ appendSpeech: {
13
+ type: "appendSpeech";
14
+ params: unknown;
15
+ };
16
+ cleanSpeech: {
17
+ type: "cleanSpeech";
18
+ params: unknown;
19
+ };
20
+ increaseIdleTimeoutCount: {
21
+ type: "increaseIdleTimeoutCount";
22
+ params: unknown;
23
+ };
24
+ resetIdleTimeoutCount: {
25
+ type: "resetIdleTimeoutCount";
26
+ params: unknown;
27
+ };
28
+ resetState: {
29
+ type: "resetState";
30
+ params: unknown;
31
+ };
32
+ setSpeaking: {
33
+ type: "setSpeaking";
34
+ params: unknown;
35
+ };
36
+ setSpeakingDone: {
37
+ type: "setSpeakingDone";
22
38
  params: unknown;
23
39
  };
24
40
  greetUser: {
25
41
  type: "greetUser";
26
42
  params: unknown;
27
43
  };
44
+ goodbye: {
45
+ type: "goodbye";
46
+ params: unknown;
47
+ };
28
48
  announceSystemError: {
29
49
  type: "announceSystemError";
30
50
  params: unknown;
@@ -37,34 +57,6 @@ declare const machine: import("xstate").StateMachine<any, {
37
57
  type: "announceIdleTimeout";
38
58
  params: unknown;
39
59
  };
40
- increaseIdleTimeoutCount: {
41
- type: "increaseIdleTimeoutCount";
42
- params: import("xstate").NonReducibleUnknown;
43
- };
44
- cleanSpeech: {
45
- type: "cleanSpeech";
46
- params: import("xstate").NonReducibleUnknown;
47
- };
48
- appendSpeech: {
49
- type: "appendSpeech";
50
- params: import("xstate").NonReducibleUnknown;
51
- };
52
- resetIdleTimeoutCount: {
53
- type: "resetIdleTimeoutCount";
54
- params: import("xstate").NonReducibleUnknown;
55
- };
56
- setSpeaking: {
57
- type: "setSpeaking";
58
- params: import("xstate").NonReducibleUnknown;
59
- };
60
- setSpeakingDone: {
61
- type: "setSpeakingDone";
62
- params: import("xstate").NonReducibleUnknown;
63
- };
64
- resetState: {
65
- type: "resetState";
66
- params: import("xstate").NonReducibleUnknown;
67
- };
68
60
  }>, import("xstate").Values<{
69
61
  isSpeaking: {
70
62
  type: "isSpeaking";
@@ -82,7 +74,7 @@ declare const machine: import("xstate").StateMachine<any, {
82
74
  conversationSettings: import("..").ConversationSettings;
83
75
  languageModel: import("..").LanguageModel;
84
76
  voice: import("..").Voice;
85
- }, import("xstate").NonReducibleUnknown, import("xstate").EventObject, import("xstate").MetaObject, {
77
+ }, {}, import("xstate").EventObject, import("xstate").MetaObject, {
86
78
  /** @xstate-layout N4IgpgJg5mDOIC5QDMB2BBAkgOigJzDABcBLVKAYgG0AGAXUVAAcB7WE0l1RkAD0QCMADgHYAzAHYAnADYJYgExCaMmSJkAaEAE9EUsQFZsUiaoUGpAhQsMSAvna1os2EhAA2YCgGUACgFF-AGEACQB9bwAVdAAlSNoGJBBWdk5uJP4EAQMAFiFxHLkJbLEaAxkBCS1dLIEcnPFFZSkpHIklQwcnDBw3Tx8A4PCY-28AVQAZePoeFI4SLh5MyzFsBUrzHJMrAxtqxAkcoxyFHMqt0pbsrpBnXo8vXlgiAEMiMGwX5He8AApMAAiE38YUimAAsv4APJjSIASgod1cDwSszY80WGUQMgMRgEUhokgMYjyMlKAn2WQUJmwEnK23a5jEQhuSL6j2ebw+Xx+-yBILBkJh8MRPWRnioAkSzHRaSWgjqNGwQnkNAU0iEYi1VR0emy2Bk+iOpU1bRkrLFRDwL1QqQWqDIUEiLEwD2oMySczlWIQygUtOyORohX0uLJlKkBlE7WJNEqZJVKgtLncJGeYAd5GdY1gYDwA0CoTC-gAcgDUZ7Zfb5VkNdgDMUVAZTYGDJSxDjjMShLGJNI+wJzY5bmLU+nM06WDm8wWhsWy5Lpckq5jQJkBGVRKdTKozhZLO2o8qtQY44dynSysmcGP3hPs7n835C8NRpNpkuvdWfZUpPkGwIVjWJquQKBGg7GB2ZQ0CYYhSDY17YAA7i88zkAAYiweDeEwhAAMYABaRCQAC2YAsAArkQs5FlEsQfmidqrnwggduIzYKCopw0DQdLlJSuISNgbRBpY1LrKcOSIShaFQJh2G4WAhHEWRlHUc+c4jOMUwVjKTHpGuiBiHU9YqFs6y8SqFSUiI4jWJYBKamSJIGNJqGkBhWE4fhRGkeRVEUE8rzvJ83x5r84LoAAGhEgxFgA6lgkSghC0KwgiSIyR5cleYpyl+WpunLvpNZ5A0Hb1AmwaSZS5iiLsWpklYwg9hILLDpl7mOvJ3lKb5qkBUFXKhbykUxRpCVJSlQrpaKLhZd1uU+Sp-lEIujEYgZLEIKeeK4lsgFtW1pRtrqO0CKswZRsGZJBsIQ7dC4TB4CweFwOw5DTngMRgAAjhRcDURAXAfGQABuLAANYfEiz2ve9jpfT9-2Awg4OvW89oJEVX7MeuuwyNgarNpU8akqdNRWPUxg8TQQjrDI9lSR1Ypw29sAfVASN-QDzw0eEdFxDjK5beuPYNJqhyWGamp05SchGHIvEXUIhrGQIDjDqgLAQHAPB3Bt3qGQgAC0F2E8SphCH+GqHEolIm0YLTO-T1u5Gq9SIfghDZYb37GybQj-pIag2zbJxCBGCiE200ikko9TyIh7J+3jiANv6FSDtSFSJ4SUcx328HBoSdKdCzLhWja+mOs6rqeKnot6kY5JRpIzIkh2EZbMq8GM8ISjwQ2iG3hmtdTo+jc1tkEEcXBKzWzIvGUhIKjGNS0iAcyZ6uRXOALZ5CnLQVVFTz60fYC1JxFzxOL8Wd8+0qcViEtH8inIhBE2lAFFMGfxuARMiIP8eQ6Z00MJHM6F1rDCVMDBOkcCVAPRHE9F67NObcxRs8f+21rBHiOvBQcZwWianlgScQJho7kkULkXeDggA */
87
79
  readonly context: ({ input }: {
88
80
  input: any;
@@ -140,21 +132,10 @@ declare const machine: import("xstate").StateMachine<any, {
140
132
  readonly actions: {
141
133
  readonly type: "goodbye";
142
134
  };
143
- readonly guard: import("xstate/dist/declarations/src/guards").GuardPredicate<any, {
144
- type: "SPEECH_START";
145
- } | {
146
- type: "SPEECH_END";
147
- } | {
148
- type: "SPEECH_RESULT";
149
- speech: string;
150
- responseTime: number;
151
- }, unknown, {
135
+ readonly guard: import("xstate/dist/declarations/src/guards").GuardPredicate<any, import("./types").AutopilotEvents, unknown, {
152
136
  type: "idleTimeoutCountExceedsMax";
153
137
  params: undefined;
154
- } | ({
155
- type: "isSpeaking";
156
- params: undefined;
157
- } & import("xstate").ParameterizedObject)>;
138
+ }>;
158
139
  }, {
159
140
  readonly target: "transitioningToIdle";
160
141
  readonly actions: readonly [{
@@ -251,32 +232,8 @@ declare const machine: import("xstate").StateMachine<any, {
251
232
  readonly description: "Process the user request";
252
233
  readonly input: ({ context }: {
253
234
  context: any;
254
- event: {
255
- type: "SPEECH_START";
256
- } | {
257
- type: "SPEECH_END";
258
- } | {
259
- type: "SPEECH_RESULT";
260
- speech: string;
261
- responseTime: number;
262
- };
263
- self: import("xstate").ActorRef<import("xstate").MachineSnapshot<any, {
264
- type: "SPEECH_START";
265
- } | {
266
- type: "SPEECH_END";
267
- } | {
268
- type: "SPEECH_RESULT";
269
- speech: string;
270
- responseTime: number;
271
- }, Record<string, import("xstate").AnyActorRef>, import("xstate").StateValue, string, unknown, any, any>, {
272
- type: "SPEECH_START";
273
- } | {
274
- type: "SPEECH_END";
275
- } | {
276
- type: "SPEECH_RESULT";
277
- speech: string;
278
- responseTime: number;
279
- }, import("xstate").AnyEventObject>;
235
+ event: import("./types").AutopilotEvents;
236
+ self: import("xstate").ActorRef<import("xstate").MachineSnapshot<any, import("./types").AutopilotEvents, Record<string, import("xstate").AnyActorRef>, import("xstate").StateValue, string, unknown, any, any>, import("./types").AutopilotEvents, import("xstate").AnyEventObject>;
280
237
  }) => {
281
238
  context: any;
282
239
  };
@@ -1,8 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.machine = void 0;
4
- // @ts-nocheck - All inputs are validated by the APIServer
5
- /*
4
+ /**
6
5
  * Copyright (C) 2025 by Fonoster Inc (https://fonoster.com)
7
6
  * http://github.com/fonoster/fonoster
8
7
  *
@@ -1,31 +1,51 @@
1
- import { AutopilotContext } from "./types";
2
1
  import { ConversationSettings } from "../assistants";
3
2
  import { LanguageModel } from "../models";
4
3
  import { Voice } from "../voice";
4
+ import { AutopilotContext, AutopilotEvents } from "./types";
5
5
  declare const machineSetup: {
6
- createMachine: <const TConfig extends import("xstate").MachineConfig<any, {
7
- type: "SPEECH_START";
8
- } | {
9
- type: "SPEECH_END";
10
- } | {
11
- type: "SPEECH_RESULT";
12
- speech: string;
13
- responseTime: number;
14
- }, {
6
+ createMachine: <const TConfig extends import("xstate").MachineConfig<any, AutopilotEvents, {
15
7
  src: "doProcessUserRequest";
16
8
  logic: import("xstate").PromiseActorLogic<void, {
17
9
  context: AutopilotContext;
18
10
  }, import("xstate").EventObject>;
19
- id: string | undefined;
11
+ id: string;
20
12
  }, import("xstate").Values<{
21
- goodbye: {
22
- type: "goodbye";
13
+ appendSpeech: {
14
+ type: "appendSpeech";
15
+ params: unknown;
16
+ };
17
+ cleanSpeech: {
18
+ type: "cleanSpeech";
19
+ params: unknown;
20
+ };
21
+ increaseIdleTimeoutCount: {
22
+ type: "increaseIdleTimeoutCount";
23
+ params: unknown;
24
+ };
25
+ resetIdleTimeoutCount: {
26
+ type: "resetIdleTimeoutCount";
27
+ params: unknown;
28
+ };
29
+ resetState: {
30
+ type: "resetState";
31
+ params: unknown;
32
+ };
33
+ setSpeaking: {
34
+ type: "setSpeaking";
35
+ params: unknown;
36
+ };
37
+ setSpeakingDone: {
38
+ type: "setSpeakingDone";
23
39
  params: unknown;
24
40
  };
25
41
  greetUser: {
26
42
  type: "greetUser";
27
43
  params: unknown;
28
44
  };
45
+ goodbye: {
46
+ type: "goodbye";
47
+ params: unknown;
48
+ };
29
49
  announceSystemError: {
30
50
  type: "announceSystemError";
31
51
  params: unknown;
@@ -38,34 +58,6 @@ declare const machineSetup: {
38
58
  type: "announceIdleTimeout";
39
59
  params: unknown;
40
60
  };
41
- increaseIdleTimeoutCount: {
42
- type: "increaseIdleTimeoutCount";
43
- params: import("xstate").NonReducibleUnknown;
44
- };
45
- cleanSpeech: {
46
- type: "cleanSpeech";
47
- params: import("xstate").NonReducibleUnknown;
48
- };
49
- appendSpeech: {
50
- type: "appendSpeech";
51
- params: import("xstate").NonReducibleUnknown;
52
- };
53
- resetIdleTimeoutCount: {
54
- type: "resetIdleTimeoutCount";
55
- params: import("xstate").NonReducibleUnknown;
56
- };
57
- setSpeaking: {
58
- type: "setSpeaking";
59
- params: import("xstate").NonReducibleUnknown;
60
- };
61
- setSpeakingDone: {
62
- type: "setSpeakingDone";
63
- params: import("xstate").NonReducibleUnknown;
64
- };
65
- resetState: {
66
- type: "resetState";
67
- params: import("xstate").NonReducibleUnknown;
68
- };
69
61
  }>, import("xstate").Values<{
70
62
  isSpeaking: {
71
63
  type: "isSpeaking";
@@ -83,33 +75,53 @@ declare const machineSetup: {
83
75
  conversationSettings: ConversationSettings;
84
76
  languageModel: LanguageModel;
85
77
  voice: Voice;
86
- }, import("xstate").NonReducibleUnknown, import("xstate").EventObject, import("xstate").MetaObject>>(config: TConfig) => import("xstate").StateMachine<any, {
87
- type: "SPEECH_START";
88
- } | {
89
- type: "SPEECH_END";
90
- } | {
91
- type: "SPEECH_RESULT";
92
- speech: string;
93
- responseTime: number;
94
- }, {
78
+ }, {}, import("xstate").EventObject, import("xstate").MetaObject>>(config: TConfig) => import("xstate").StateMachine<any, AutopilotEvents, {
95
79
  [x: string]: import("xstate").ActorRefFromLogic<import("xstate").PromiseActorLogic<void, {
96
80
  context: AutopilotContext;
97
- }, import("xstate").EventObject>> | undefined;
81
+ }, import("xstate").EventObject>>;
98
82
  }, {
99
83
  src: "doProcessUserRequest";
100
84
  logic: import("xstate").PromiseActorLogic<void, {
101
85
  context: AutopilotContext;
102
86
  }, import("xstate").EventObject>;
103
- id: string | undefined;
87
+ id: string;
104
88
  }, import("xstate").Values<{
105
- goodbye: {
106
- type: "goodbye";
89
+ appendSpeech: {
90
+ type: "appendSpeech";
91
+ params: unknown;
92
+ };
93
+ cleanSpeech: {
94
+ type: "cleanSpeech";
95
+ params: unknown;
96
+ };
97
+ increaseIdleTimeoutCount: {
98
+ type: "increaseIdleTimeoutCount";
99
+ params: unknown;
100
+ };
101
+ resetIdleTimeoutCount: {
102
+ type: "resetIdleTimeoutCount";
103
+ params: unknown;
104
+ };
105
+ resetState: {
106
+ type: "resetState";
107
+ params: unknown;
108
+ };
109
+ setSpeaking: {
110
+ type: "setSpeaking";
111
+ params: unknown;
112
+ };
113
+ setSpeakingDone: {
114
+ type: "setSpeakingDone";
107
115
  params: unknown;
108
116
  };
109
117
  greetUser: {
110
118
  type: "greetUser";
111
119
  params: unknown;
112
120
  };
121
+ goodbye: {
122
+ type: "goodbye";
123
+ params: unknown;
124
+ };
113
125
  announceSystemError: {
114
126
  type: "announceSystemError";
115
127
  params: unknown;
@@ -122,34 +134,6 @@ declare const machineSetup: {
122
134
  type: "announceIdleTimeout";
123
135
  params: unknown;
124
136
  };
125
- increaseIdleTimeoutCount: {
126
- type: "increaseIdleTimeoutCount";
127
- params: import("xstate").NonReducibleUnknown;
128
- };
129
- cleanSpeech: {
130
- type: "cleanSpeech";
131
- params: import("xstate").NonReducibleUnknown;
132
- };
133
- appendSpeech: {
134
- type: "appendSpeech";
135
- params: import("xstate").NonReducibleUnknown;
136
- };
137
- resetIdleTimeoutCount: {
138
- type: "resetIdleTimeoutCount";
139
- params: import("xstate").NonReducibleUnknown;
140
- };
141
- setSpeaking: {
142
- type: "setSpeaking";
143
- params: import("xstate").NonReducibleUnknown;
144
- };
145
- setSpeakingDone: {
146
- type: "setSpeakingDone";
147
- params: import("xstate").NonReducibleUnknown;
148
- };
149
- resetState: {
150
- type: "resetState";
151
- params: import("xstate").NonReducibleUnknown;
152
- };
153
137
  }>, import("xstate").Values<{
154
138
  isSpeaking: {
155
139
  type: "isSpeaking";
@@ -167,6 +151,6 @@ declare const machineSetup: {
167
151
  conversationSettings: ConversationSettings;
168
152
  languageModel: LanguageModel;
169
153
  voice: Voice;
170
- }, import("xstate").NonReducibleUnknown, import("xstate").EventObject, import("xstate").MetaObject, TConfig>;
154
+ }, {}, import("xstate").EventObject, import("xstate").MetaObject, TConfig>;
171
155
  };
172
156
  export { machineSetup };