






















@@ -766,6 +766,128 @@ describe("google-meet plugin", () => {
766766});
767767});
768768769+it("reuses active Meet sessions across URL query differences", async () => {
770+const { methods, nodesInvoke } = setup(
771+{
772+defaultTransport: "chrome-node",
773+defaultMode: "transcribe",
774+},
775+{
776+nodesInvokeResult: {
777+payload: {
778+launched: true,
779+browser: { inCall: true, micMuted: false },
780+},
781+},
782+},
783+);
784+const handler = methods.get("googlemeet.join") as
785+| ((ctx: {
786+params: Record<string, unknown>;
787+respond: ReturnType<typeof vi.fn>;
788+}) => Promise<void>)
789+| undefined;
790+const first = vi.fn();
791+const second = vi.fn();
792+793+await handler?.({
794+params: { url: "https://meet.google.com/abc-defg-hij?authuser=me@example.com" },
795+respond: first,
796+});
797+await handler?.({
798+params: { url: "https://meet.google.com/abc-defg-hij" },
799+respond: second,
800+});
801+802+expect(
803+nodesInvoke.mock.calls.filter(([call]) => call.command === "googlemeet.chrome"),
804+).toHaveLength(1);
805+expect(second.mock.calls[0]?.[1]).toMatchObject({
806+session: {
807+notes: expect.arrayContaining(["Reused existing active Meet session."]),
808+},
809+});
810+});
811+812+it("reuses existing Meet browser tabs across URL query differences", async () => {
813+const { methods, nodesInvoke } = setup(
814+{
815+defaultTransport: "chrome-node",
816+defaultMode: "transcribe",
817+},
818+{
819+nodesInvokeHandler: async (params) => {
820+if (params.command !== "browser.proxy") {
821+return { payload: { launched: true } };
822+}
823+const proxy = params.params as {
824+path?: string;
825+body?: { targetId?: string; url?: string };
826+};
827+if (proxy.path === "/tabs") {
828+return {
829+payload: {
830+result: {
831+running: true,
832+tabs: [
833+{
834+targetId: "existing-meet-tab",
835+title: "Meet",
836+url: "https://meet.google.com/abc-defg-hij?authuser=me@example.com",
837+},
838+],
839+},
840+},
841+};
842+}
843+if (proxy.path === "/tabs/focus") {
844+return { payload: { result: { ok: true } } };
845+}
846+if (proxy.path === "/act") {
847+return {
848+payload: {
849+result: {
850+result: JSON.stringify({
851+inCall: true,
852+title: "Meet",
853+url: "https://meet.google.com/abc-defg-hij?authuser=me@example.com",
854+}),
855+},
856+},
857+};
858+}
859+throw new Error(`unexpected browser proxy path ${proxy.path}`);
860+},
861+},
862+);
863+const handler = methods.get("googlemeet.join") as
864+| ((ctx: {
865+params: Record<string, unknown>;
866+respond: ReturnType<typeof vi.fn>;
867+}) => Promise<void>)
868+| undefined;
869+const respond = vi.fn();
870+871+await handler?.({
872+params: { url: "https://meet.google.com/abc-defg-hij" },
873+ respond,
874+});
875+876+expect(nodesInvoke).toHaveBeenCalledWith(
877+expect.objectContaining({
878+params: expect.objectContaining({
879+path: "/tabs/focus",
880+body: { targetId: "existing-meet-tab" },
881+}),
882+}),
883+);
884+expect(nodesInvoke).not.toHaveBeenCalledWith(
885+expect.objectContaining({
886+params: expect.objectContaining({ path: "/tabs/open" }),
887+}),
888+);
889+});
890+769891it("exposes a test-speech action that joins the requested meeting", async () => {
770892const { tools, nodesInvoke } = setup(
771893{
@@ -1072,6 +1194,14 @@ describe("google-meet plugin", () => {
10721194expect(bridge.triggerGreeting).not.toHaveBeenCalled();
10731195handle.speak("Say exactly: hello from the meeting.");
10741196expect(bridge.triggerGreeting).toHaveBeenLastCalledWith("Say exactly: hello from the meeting.");
1197+expect(handle.getHealth()).toMatchObject({
1198+providerConnected: true,
1199+realtimeReady: true,
1200+audioInputActive: true,
1201+audioOutputActive: true,
1202+lastInputBytes: 3,
1203+lastOutputBytes: 2,
1204+});
10751205expect(callbacks).toMatchObject({
10761206tools: [
10771207expect.objectContaining({
@@ -1226,6 +1356,14 @@ describe("google-meet plugin", () => {
12261356nodeId: "node-1",
12271357bridgeId: "bridge-1",
12281358});
1359+expect(handle.getHealth()).toMatchObject({
1360+providerConnected: true,
1361+realtimeReady: true,
1362+audioInputActive: true,
1363+audioOutputActive: true,
1364+lastInputBytes: 3,
1365+lastOutputBytes: 3,
1366+});
1229136712301368await handle.stop();
12311369此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。