


















@@ -35,8 +35,13 @@ import { buildMeetDtmfSequence, normalizeDialInNumber } from "./src/transports/t
3535import type { GoogleMeetSession } from "./src/transports/types.js";
36363737const voiceCallMocks = vi.hoisted(() => ({
38-joinMeetViaVoiceCallGateway: vi.fn(async () => ({ callId: "call-1", dtmfSent: true })),
38+joinMeetViaVoiceCallGateway: vi.fn(async () => ({
39+callId: "call-1",
40+dtmfSent: true,
41+introSent: true,
42+})),
3943endMeetVoiceCallGatewayCall: vi.fn(async () => {}),
44+speakMeetViaVoiceCallGateway: vi.fn(async () => {}),
4045}));
41464247const fetchGuardMocks = vi.hoisted(() => ({
@@ -61,6 +66,7 @@ vi.mock("openclaw/plugin-sdk/ssrf-runtime", () => ({
6166vi.mock("./src/voice-call-gateway.js", () => ({
6267joinMeetViaVoiceCallGateway: voiceCallMocks.joinMeetViaVoiceCallGateway,
6368endMeetVoiceCallGatewayCall: voiceCallMocks.endMeetVoiceCallGatewayCall,
69+speakMeetViaVoiceCallGateway: voiceCallMocks.speakMeetViaVoiceCallGateway,
6470}));
65716672function setup(
@@ -348,7 +354,12 @@ describe("google-meet plugin", () => {
348354"BlackHole 2ch",
349355],
350356},
351-voiceCall: { enabled: true, requestTimeoutMs: 30000, dtmfDelayMs: 2500 },
357+voiceCall: {
358+enabled: true,
359+requestTimeoutMs: 30000,
360+dtmfDelayMs: 2500,
361+postDtmfSpeechDelayMs: 5000,
362+},
352363realtime: {
353364provider: "openai",
354365introMessage: "Say exactly: I'm here and listening.",
@@ -955,12 +966,14 @@ describe("google-meet plugin", () => {
955966dtmfSequence: "123456#",
956967voiceCallId: "call-1",
957968dtmfSent: true,
969+introSent: true,
958970},
959971});
960972expect(voiceCallMocks.joinMeetViaVoiceCallGateway).toHaveBeenCalledWith({
961973config: expect.objectContaining({ defaultTransport: "twilio" }),
962974dialInNumber: "+15551234567",
963975dtmfSequence: "123456#",
976+message: "Say exactly: I'm here and listening.",
964977});
965978});
966979@@ -984,6 +997,32 @@ describe("google-meet plugin", () => {
984997});
985998});
9869991000+it("delegates Twilio session speech through voice-call", async () => {
1001+const { tools } = setup({ defaultTransport: "twilio" });
1002+const tool = tools[0] as {
1003+execute: (id: string, params: unknown) => Promise<{ details: { session: { id: string } } }>;
1004+};
1005+const joined = await tool.execute("id", {
1006+action: "join",
1007+url: "https://meet.google.com/abc-defg-hij",
1008+dialInNumber: "+15551234567",
1009+pin: "123456",
1010+});
1011+1012+const spoken = await tool.execute("id", {
1013+action: "speak",
1014+sessionId: joined.details.session.id,
1015+message: "Say exactly: hello after joining.",
1016+});
1017+1018+expect(spoken.details).toMatchObject({ spoken: true });
1019+expect(voiceCallMocks.speakMeetViaVoiceCallGateway).toHaveBeenCalledWith({
1020+config: expect.objectContaining({ defaultTransport: "twilio" }),
1021+callId: "call-1",
1022+message: "Say exactly: hello after joining.",
1023+});
1024+});
1025+9871026it("reports setup status through the tool", async () => {
9881027const originalPlatform = process.platform;
9891028Object.defineProperty(process, "platform", { value: "darwin" });
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。