

























@@ -1068,6 +1068,21 @@ describe("google-meet plugin", () => {
10681068});
10691069});
107010701071+it("explains that Twilio joins need dial-in details", async () => {
1072+const { tools } = setup({ defaultTransport: "twilio" });
1073+const tool = tools[0] as {
1074+execute: (id: string, params: unknown) => Promise<{ details: { error?: string } }>;
1075+};
1076+1077+const result = await tool.execute("id", {
1078+action: "join",
1079+url: "https://meet.google.com/abc-defg-hij",
1080+});
1081+1082+expect(result.details.error).toContain("Twilio transport requires a Meet dial-in phone number");
1083+expect(result.details.error).toContain("Google Meet URLs do not include dial-in details");
1084+});
1085+10711086it("hangs up delegated Twilio calls on leave", async () => {
10721087const { tools } = setup({ defaultTransport: "twilio" });
10731088const tool = tools[0] as {
@@ -1619,6 +1634,98 @@ describe("google-meet plugin", () => {
16191634);
16201635});
162116361637+it("reports missing Twilio dial plan for explicit Twilio setup", async () => {
1638+vi.stubEnv("TWILIO_ACCOUNT_SID", "AC123");
1639+vi.stubEnv("TWILIO_AUTH_TOKEN", "secret");
1640+vi.stubEnv("TWILIO_FROM_NUMBER", "+15550001234");
1641+const { tools } = setup(
1642+{ defaultTransport: "chrome" },
1643+{
1644+fullConfig: {
1645+plugins: {
1646+allow: ["google-meet", "voice-call"],
1647+entries: {
1648+"voice-call": {
1649+enabled: true,
1650+config: {
1651+provider: "twilio",
1652+publicUrl: "https://voice.example.com/voice/webhook",
1653+},
1654+},
1655+},
1656+},
1657+},
1658+},
1659+);
1660+const tool = tools[0] as {
1661+execute: (
1662+id: string,
1663+params: unknown,
1664+) => Promise<{ details: { ok?: boolean; checks?: unknown[] } }>;
1665+};
1666+1667+const result = await tool.execute("id", { action: "setup_status", transport: "twilio" });
1668+1669+expect(result.details.ok).toBe(false);
1670+expect(result.details.checks).toEqual(
1671+expect.arrayContaining([
1672+expect.objectContaining({
1673+id: "twilio-dial-plan",
1674+ok: false,
1675+message: expect.stringContaining("dial-in phone number"),
1676+}),
1677+]),
1678+);
1679+});
1680+1681+it("accepts request-provided Twilio dial-in details during setup", async () => {
1682+vi.stubEnv("TWILIO_ACCOUNT_SID", "AC123");
1683+vi.stubEnv("TWILIO_AUTH_TOKEN", "secret");
1684+vi.stubEnv("TWILIO_FROM_NUMBER", "+15550001234");
1685+const { tools } = setup(
1686+{ defaultTransport: "chrome" },
1687+{
1688+fullConfig: {
1689+plugins: {
1690+allow: ["google-meet", "voice-call"],
1691+entries: {
1692+"voice-call": {
1693+enabled: true,
1694+config: {
1695+provider: "twilio",
1696+publicUrl: "https://voice.example.com/voice/webhook",
1697+},
1698+},
1699+},
1700+},
1701+},
1702+},
1703+);
1704+const tool = tools[0] as {
1705+execute: (
1706+id: string,
1707+params: unknown,
1708+) => Promise<{ details: { ok?: boolean; checks?: unknown[] } }>;
1709+};
1710+1711+const result = await tool.execute("id", {
1712+action: "setup_status",
1713+transport: "twilio",
1714+dialInNumber: "+15551234567",
1715+});
1716+1717+expect(result.details.ok).toBe(true);
1718+expect(result.details.checks).toEqual(
1719+expect.arrayContaining([
1720+expect.objectContaining({
1721+id: "twilio-dial-plan",
1722+ok: true,
1723+message: expect.stringContaining("request includes"),
1724+}),
1725+]),
1726+);
1727+});
1728+16221729it.each([
16231730"http://127.0.0.1:3334/voice/webhook",
16241731"http://[::1]:3334/voice/webhook",
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。