




















@@ -1254,46 +1254,39 @@ describe("google-meet plugin", () => {
12541254});
12551255vi.stubGlobal("fetch", fetchMock);
125612561257-await expect(
1258-fetchGoogleMeetAttendance({
1259-accessToken: "token",
1260-conferenceRecord: "rec-1",
1261-}),
1262-).resolves.toMatchObject({
1263-attendance: [
1264-{
1265-displayName: "Alice",
1266-participants: [
1267-"conferenceRecords/rec-1/participants/p1",
1268-"conferenceRecords/rec-1/participants/p2",
1269-],
1270-firstJoinTime: "2026-04-25T10:10:00.000Z",
1271-lastLeaveTime: "2026-04-25T10:50:00.000Z",
1272-durationMs: 1_800_000,
1273-late: true,
1274-earlyLeave: true,
1275-sessions: [
1276-{ name: expect.stringContaining("/p1/") },
1277-{ name: expect.stringContaining("/p2/") },
1278-],
1279-},
1280-],
1257+const result = await fetchGoogleMeetAttendance({
1258+accessToken: "token",
1259+conferenceRecord: "rec-1",
12811260});
1261+expect(result.attendance).toHaveLength(1);
1262+const row = result.attendance[0];
1263+expect(row?.displayName).toBe("Alice");
1264+expect(row?.participants).toEqual([
1265+"conferenceRecords/rec-1/participants/p1",
1266+"conferenceRecords/rec-1/participants/p2",
1267+]);
1268+expect(row?.firstJoinTime).toBe("2026-04-25T10:10:00.000Z");
1269+expect(row?.lastLeaveTime).toBe("2026-04-25T10:50:00.000Z");
1270+expect(row?.durationMs).toBe(1_800_000);
1271+expect(row?.late).toBe(true);
1272+expect(row?.earlyLeave).toBe(true);
1273+expect(row?.sessions.map((session) => session.name)).toEqual([
1274+"conferenceRecords/rec-1/participants/p1/participantSessions/s1",
1275+"conferenceRecords/rec-1/participants/p2/participantSessions/s1",
1276+]);
12821277});
1283127812841279it("surfaces Developer Preview acknowledgment blockers in preflight reports", () => {
1285-expect(
1286-buildGoogleMeetPreflightReport({
1287-input: "abc-defg-hij",
1288-space: { name: "spaces/abc-defg-hij" },
1289-previewAcknowledged: false,
1290-tokenSource: "cached-access-token",
1291-}),
1292-).toMatchObject({
1293-resolvedSpaceName: "spaces/abc-defg-hij",
1280+const report = buildGoogleMeetPreflightReport({
1281+input: "abc-defg-hij",
1282+space: { name: "spaces/abc-defg-hij" },
12941283previewAcknowledged: false,
1295-blockers: [expect.stringContaining("Developer Preview Program")],
1284+tokenSource: "cached-access-token",
12961285});
1286+expect(report.resolvedSpaceName).toBe("spaces/abc-defg-hij");
1287+expect(report.previewAcknowledged).toBe(false);
1288+expect(report.blockers).toHaveLength(1);
1289+expect(report.blockers[0]).toContain("Developer Preview Program");
12971290});
1298129112991292it("builds Twilio dial plans from a PIN", () => {
@@ -1315,28 +1308,27 @@ describe("google-meet plugin", () => {
13151308pin: "123456",
13161309});
131713101318-expect(result.details.session).toMatchObject({
1319-transport: "twilio",
1320-mode: "agent",
1321-twilio: {
1322-dialInNumber: "+15551234567",
1323-pinProvided: true,
1324-dtmfSequence: "wwwwwwwwwwwwwwwwwwwwwwww123456#",
1325-voiceCallId: "call-1",
1326-dtmfSent: true,
1327-introSent: true,
1328-},
1311+const session = requireRecord(result.details.session, "Twilio session");
1312+expect(session.transport).toBe("twilio");
1313+expect(session.mode).toBe("agent");
1314+expect(session.twilio).toEqual({
1315+dialInNumber: "+15551234567",
1316+pinProvided: true,
1317+dtmfSequence: "wwwwwwwwwwwwwwwwwwwwwwww123456#",
1318+voiceCallId: "call-1",
1319+dtmfSent: true,
1320+introSent: true,
13291321});
1330-expect(voiceCallMocks.joinMeetViaVoiceCallGateway).toHaveBeenCalledWith(
1331-expect.objectContaining({
1332-config: expect.objectContaining({ defaultTransport: "twilio" }),
1333-dialInNumber: "+15551234567",
1334-dtmfSequence: "wwwwwwwwwwwwwwwwwwwwwwww123456#",
1335-logger: expect.objectContaining({ info: expect.any(Function) }),
1336-message: "Say exactly: I'm here and listening.",
1337-sessionKey: expect.stringMatching(/^voice:google-meet:meet_/),
1338-}),
1322+const [voiceCallParams] = voiceCallMocks.joinMeetViaVoiceCallGateway.mock
1323+.calls[0] as unknown as [Record<string, unknown>];
1324+expect(requireRecord(voiceCallParams.config, "voice-call config").defaultTransport).toBe(
1325+"twilio",
13391326);
1327+expect(voiceCallParams.dialInNumber).toBe("+15551234567");
1328+expect(voiceCallParams.dtmfSequence).toBe("wwwwwwwwwwwwwwwwwwwwwwww123456#");
1329+expect(typeof requireRecord(voiceCallParams.logger, "voice-call logger").info).toBe("function");
1330+expect(voiceCallParams.message).toBe("Say exactly: I'm here and listening.");
1331+expect(String(voiceCallParams.sessionKey)).toMatch(/^voice:google-meet:meet_/);
13401332});
1341133313421334it("passes the caller session key through tool joins for agent context forking", async () => {
@@ -1359,10 +1351,9 @@ describe("google-meet plugin", () => {
13591351requesterSessionKey: "agent:main:wrong",
13601352});
136113531362-expect(gatewayParams[0]).toMatchObject({
1363-url: "https://meet.google.com/abc-defg-hij",
1364-requesterSessionKey: "agent:main:discord:channel:general",
1365-});
1354+const gatewayJoinParams = requireRecord(gatewayParams[0], "gateway join params");
1355+expect(gatewayJoinParams.url).toBe("https://meet.google.com/abc-defg-hij");
1356+expect(gatewayJoinParams.requesterSessionKey).toBe("agent:main:discord:channel:general");
13661357});
1367135813681359it("explains that Twilio joins need dial-in details", async () => {
@@ -1394,8 +1385,15 @@ describe("google-meet plugin", () => {
1394138513951386await tool.execute("id", { action: "leave", sessionId: joined.details.session.id });
139613871388+const [endParams] = voiceCallMocks.endMeetVoiceCallGatewayCall.mock.calls[0] as unknown as [
1389+Record<string, unknown>,
1390+];
1391+expect(requireRecord(endParams.config, "voice-call end config").defaultTransport).toBe(
1392+"twilio",
1393+);
1394+expect(endParams.callId).toBe("call-1");
13971395expect(voiceCallMocks.endMeetVoiceCallGatewayCall).toHaveBeenCalledWith({
1398-config: expect.objectContaining({ defaultTransport: "twilio" }),
1396+config: endParams.config,
13991397callId: "call-1",
14001398});
14011399});
@@ -1446,9 +1444,17 @@ describe("google-meet plugin", () => {
14461444message: "Say exactly: hello after joining.",
14471445});
144814461449-expect(spoken.details).toMatchObject({ spoken: true });
1447+expect(requireRecord(spoken.details, "spoken details").spoken).toBe(true);
1448+const [speakParams] = voiceCallMocks.speakMeetViaVoiceCallGateway.mock.calls[0] as unknown as [
1449+Record<string, unknown>,
1450+];
1451+expect(requireRecord(speakParams.config, "voice-call speak config").defaultTransport).toBe(
1452+"twilio",
1453+);
1454+expect(speakParams.callId).toBe("call-1");
1455+expect(speakParams.message).toBe("Say exactly: hello after joining.");
14501456expect(voiceCallMocks.speakMeetViaVoiceCallGateway).toHaveBeenCalledWith({
1451-config: expect.objectContaining({ defaultTransport: "twilio" }),
1457+config: speakParams.config,
14521458callId: "call-1",
14531459message: "Say exactly: hello after joining.",
14541460});
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。