惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

WordPress大学
WordPress大学
Jina AI
Jina AI
小众软件
小众软件
GbyAI
GbyAI
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
博客园 - 【当耐特】
D
DataBreaches.Net
腾讯CDC
V
Visual Studio Blog
博客园 - 叶小钗
B
Blog
Apple Machine Learning Research
Apple Machine Learning Research
T
The Blog of Author Tim Ferriss
S
SegmentFault 最新的问题
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
V
V2EX
博客园 - 三生石上(FineUI控件)
云风的 BLOG
云风的 BLOG
The Cloudflare Blog
MongoDB | Blog
MongoDB | Blog
有赞技术团队
有赞技术团队
U
Unit 42
博客园 - 司徒正美
博客园 - 聂微东

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
test(google-meet): share plugin harness · openclaw/opencl...
steipete · 2026-04-25 · via Recent Commits to openclaw:main

@@ -1,10 +1,8 @@

11

import { EventEmitter } from "node:events";

22

import { PassThrough, Writable } from "node:stream";

33

import { Command } from "commander";

4-

import type { OpenClawPluginApi } from "openclaw/plugin-sdk/plugin-entry";

54

import type { RealtimeVoiceProviderPlugin } from "openclaw/plugin-sdk/realtime-voice";

65

import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";

7-

import { createTestPluginApi } from "../../test/helpers/plugins/plugin-api.ts";

86

import plugin from "./index.js";

97

import { registerGoogleMeetCli } from "./src/cli.js";

108

import { resolveGoogleMeetConfig, resolveGoogleMeetConfigWithEnv } from "./src/config.js";

@@ -23,6 +21,11 @@ import { startNodeRealtimeAudioBridge } from "./src/realtime-node.js";

2321

import { startCommandRealtimeAudioBridge } from "./src/realtime.js";

2422

import { normalizeMeetUrl } from "./src/runtime.js";

2523

import type { GoogleMeetRuntime } from "./src/runtime.js";

24+

import {

25+

captureStdout,

26+

noopLogger,

27+

setupGoogleMeetPlugin,

28+

} from "./src/test-support/plugin-harness.js";

2629

import { buildMeetDtmfSequence, normalizeDialInNumber } from "./src/transports/twilio.js";

27302831

const voiceCallMocks = vi.hoisted(() => ({

@@ -54,23 +57,11 @@ vi.mock("./src/voice-call-gateway.js", () => ({

5457

endMeetVoiceCallGatewayCall: voiceCallMocks.endMeetVoiceCallGatewayCall,

5558

}));

565957-

const noopLogger = {

58-

info: vi.fn(),

59-

warn: vi.fn(),

60-

error: vi.fn(),

61-

debug: vi.fn(),

62-

};

63-64-

function captureStdout() {

65-

let output = "";

66-

const writeSpy = vi.spyOn(process.stdout, "write").mockImplementation(((chunk: unknown) => {

67-

output += String(chunk);

68-

return true;

69-

}) as typeof process.stdout.write);

70-

return {

71-

output: () => output,

72-

restore: () => writeSpy.mockRestore(),

73-

};

60+

function setup(

61+

config?: Parameters<typeof setupGoogleMeetPlugin>[1],

62+

options?: Parameters<typeof setupGoogleMeetPlugin>[2],

63+

) {

64+

return setupGoogleMeetPlugin(plugin, config, options);

7465

}

75667667

type TestBridgeProcess = {

@@ -82,134 +73,6 @@ type TestBridgeProcess = {

8273

on: EventEmitter["on"];

8374

};

847585-

type NodeListResult = {

86-

nodes: Array<{

87-

nodeId: string;

88-

displayName?: string;

89-

connected?: boolean;

90-

commands?: string[];

91-

caps?: string[];

92-

remoteIp?: string;

93-

}>;

94-

};

95-96-

function setup(

97-

config: Record<string, unknown> = {},

98-

options: {

99-

fullConfig?: Record<string, unknown>;

100-

nodesListResult?: NodeListResult;

101-

nodesInvokeResult?: unknown;

102-

browserActResult?: Record<string, unknown>;

103-

nodesInvokeHandler?: (params: {

104-

nodeId: string;

105-

command: string;

106-

params?: unknown;

107-

timeoutMs?: number;

108-

}) => Promise<unknown>;

109-

} = {},

110-

) {

111-

const methods = new Map<string, unknown>();

112-

const tools: unknown[] = [];

113-

const cliRegistrations: unknown[] = [];

114-

const nodeHostCommands: unknown[] = [];

115-

const nodesList = vi.fn(

116-

async () =>

117-

options.nodesListResult ?? {

118-

nodes: [

119-

{

120-

nodeId: "node-1",

121-

displayName: "parallels-macos",

122-

connected: true,

123-

caps: ["browser"],

124-

commands: ["browser.proxy", "googlemeet.chrome"],

125-

},

126-

],

127-

},

128-

);

129-

const nodesInvoke = vi.fn(async (params) => {

130-

if (options.nodesInvokeHandler) {

131-

return options.nodesInvokeHandler(params);

132-

}

133-

if (params.command === "browser.proxy") {

134-

const proxy = params.params as { path?: string; body?: { url?: string; targetId?: string } };

135-

if (proxy.path === "/tabs") {

136-

return { payload: { result: { running: true, tabs: [] } } };

137-

}

138-

if (proxy.path === "/tabs/open") {

139-

return {

140-

payload: {

141-

result: {

142-

targetId: "tab-1",

143-

title: "Meet",

144-

url: proxy.body?.url ?? "https://meet.google.com/abc-defg-hij",

145-

},

146-

},

147-

};

148-

}

149-

if (proxy.path === "/act") {

150-

return {

151-

payload: {

152-

result: {

153-

ok: true,

154-

targetId: proxy.body?.targetId ?? "tab-1",

155-

result: JSON.stringify(

156-

options.browserActResult ?? {

157-

inCall: true,

158-

micMuted: false,

159-

title: "Meet call",

160-

url: "https://meet.google.com/abc-defg-hij",

161-

},

162-

),

163-

},

164-

},

165-

};

166-

}

167-

return { payload: { result: { ok: true } } };

168-

}

169-

return options.nodesInvokeResult ?? { launched: true };

170-

});

171-

const runCommandWithTimeout = vi.fn(async (argv: string[]) => {

172-

if (argv[0] === "/usr/sbin/system_profiler") {

173-

return { code: 0, stdout: "BlackHole 2ch", stderr: "" };

174-

}

175-

return { code: 0, stdout: "", stderr: "" };

176-

});

177-

const api = createTestPluginApi({

178-

id: "google-meet",

179-

name: "Google Meet",

180-

description: "test",

181-

version: "0",

182-

source: "test",

183-

config: options.fullConfig ?? {},

184-

pluginConfig: config,

185-

runtime: {

186-

system: {

187-

runCommandWithTimeout,

188-

formatNativeDependencyHint: vi.fn(() => "Install with brew install blackhole-2ch."),

189-

},

190-

nodes: {

191-

list: nodesList,

192-

invoke: nodesInvoke,

193-

},

194-

} as unknown as OpenClawPluginApi["runtime"],

195-

logger: noopLogger,

196-

registerGatewayMethod: (method: string, handler: unknown) => methods.set(method, handler),

197-

registerTool: (tool: unknown) => tools.push(tool),

198-

registerCli: (_registrar: unknown, opts: unknown) => cliRegistrations.push(opts),

199-

registerNodeHostCommand: (command: unknown) => nodeHostCommands.push(command),

200-

});

201-

plugin.register(api);

202-

return {

203-

cliRegistrations,

204-

methods,

205-

tools,

206-

runCommandWithTimeout,

207-

nodesList,

208-

nodesInvoke,

209-

nodeHostCommands,

210-

};

211-

}

212-21376

describe("google-meet plugin", () => {

21477

beforeEach(() => {

21578

vi.clearAllMocks();