@fonoster/autopilot 0.23.0 → 0.25.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -67,7 +67,7 @@ const sendConversationStartedEvent_1 = require("./sendConversationStartedEvent")
67
67
  const _1 = __importStar(require("."));
68
68
  const logger = (0, logger_1.getLogger)({ service: "autopilot", filePath: __filename });
69
69
  async function handleVoiceRequest(req, res) {
70
- const { accessKeyId, callerNumber, ingressNumber, mediaSessionRef, appRef, callRef, callDirection, metadata } = req;
70
+ const { accessKeyId, callerNumber, ingressNumber, mediaSessionRef, appRef, callRef, callDirection, metadata, amd } = req;
71
71
  logger.verbose("voice request", {
72
72
  accessKeyId,
73
73
  ingressNumber,
@@ -154,7 +154,8 @@ async function handleVoiceRequest(req, res) {
154
154
  callRef,
155
155
  phone: ingressNumber,
156
156
  chatHistory: chatHistory,
157
- recordingUrl
157
+ recordingUrl,
158
+ amd
158
159
  });
159
160
  }
160
161
  });
@@ -16,7 +16,7 @@
16
16
  * See the License for the specific language governing permissions and
17
17
  * limitations under the License.
18
18
  */
19
- import { EventsHookAllowedEvents } from "@fonoster/common";
19
+ import { Amd, EventsHookAllowedEvents } from "@fonoster/common";
20
20
  export type EventsHook = {
21
21
  url: string;
22
22
  events: EventsHookAllowedEvents[];
@@ -28,4 +28,5 @@ export declare function sendConversationEndedEvent(eventsHook: EventsHook, data:
28
28
  phone: string;
29
29
  chatHistory: Record<string, string>[];
30
30
  recordingUrl: string;
31
+ amd?: Amd;
31
32
  }): Promise<void>;
@@ -23,7 +23,7 @@ const common_1 = require("@fonoster/common");
23
23
  const logger_1 = require("@fonoster/logger");
24
24
  const logger = (0, logger_1.getLogger)({ service: "autopilot", filePath: __filename });
25
25
  async function sendConversationEndedEvent(eventsHook, data) {
26
- const { chatHistory, phone, appRef, callRef, recordingUrl } = data;
26
+ const { chatHistory, phone, appRef, callRef, recordingUrl, amd } = data;
27
27
  if (!eventsHook?.events.includes(common_1.EventsHookAllowedEvents.CONVERSATION_ENDED) &&
28
28
  !eventsHook?.events.includes(common_1.EventsHookAllowedEvents.ALL)) {
29
29
  return;
@@ -35,7 +35,8 @@ async function sendConversationEndedEvent(eventsHook, data) {
35
35
  callRef,
36
36
  phone,
37
37
  chatHistory,
38
- ...(recordingUrl && { recordingUrl })
38
+ ...(recordingUrl && { recordingUrl }),
39
+ ...(amd && { amd })
39
40
  };
40
41
  logger.verbose("dispatching conversation.ended webhook", {
41
42
  url: parsedEventsHook.url,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fonoster/autopilot",
3
- "version": "0.23.0",
3
+ "version": "0.25.0",
4
4
  "description": "Voice AI for the Fonoster platform",
5
5
  "author": "Pedro Sanders <psanders@fonoster.com>",
6
6
  "homepage": "https://github.com/fonoster/fonoster#readme",
@@ -35,11 +35,11 @@
35
35
  "dependencies": {
36
36
  "@aws-sdk/client-s3": "^3.958.0",
37
37
  "@dmitryrechkin/json-schema-to-zod": "^1.0.1",
38
- "@fonoster/common": "^0.23.0",
39
- "@fonoster/logger": "^0.23.0",
40
- "@fonoster/sdk": "^0.23.0",
41
- "@fonoster/types": "^0.23.0",
42
- "@fonoster/voice": "^0.23.0",
38
+ "@fonoster/common": "^0.25.0",
39
+ "@fonoster/logger": "^0.25.0",
40
+ "@fonoster/sdk": "^0.25.0",
41
+ "@fonoster/types": "^0.25.0",
42
+ "@fonoster/voice": "^0.25.0",
43
43
  "@langchain/anthropic": "^1.3.3",
44
44
  "@langchain/community": "^1.1.1",
45
45
  "@langchain/core": "^1.1.8",
@@ -59,5 +59,5 @@
59
59
  "xstate": "^5.17.3",
60
60
  "zod": "^3.25.76"
61
61
  },
62
- "gitHead": "acdd199a840d56419e25dae015d3b74892fe86cc"
62
+ "gitHead": "3f63a173d31c0dbf2391b1eff907c8880e60614d"
63
63
  }