

























11/** Tests bundled plugin config secret collectors. */
2+import { fileURLToPath } from "node:url";
23import { describe, expect, it } from "vitest";
34import { resolveAgentWorkspaceDir, resolveDefaultAgentId } from "../agents/agent-scope.js";
45import type { OpenClawConfig } from "../config/config.js";
@@ -104,4 +105,61 @@ describe("collectPluginConfigAssignments bundled plugin manifests", () => {
104105warnings: [],
105106});
106107});
108+109+it("collects google-meet realtime provider SecretRefs from its installed manifest", () => {
110+const googleMeetPluginDir = fileURLToPath(
111+new URL("../../extensions/google-meet", import.meta.url),
112+);
113+const config = {
114+plugins: {
115+load: { paths: [googleMeetPluginDir] },
116+entries: {
117+"google-meet": {
118+enabled: true,
119+config: {
120+realtime: {
121+providers: {
122+google: {
123+apiKey: envRef("GEMINI_API_KEY"),
124+},
125+openai: {
126+apiKey: envRef("OPENAI_API_KEY"),
127+},
128+},
129+},
130+},
131+},
132+},
133+},
134+} as OpenClawConfig;
135+expect(
136+resolvePluginConfigContractsById({
137+ config,
138+env: {},
139+pluginIds: ["google-meet"],
140+}).get("google-meet")?.configContracts.secretInputs?.paths,
141+).toEqual([{ path: "realtime.providers.*.apiKey", expected: "string" }]);
142+const context = createResolverContext({
143+sourceConfig: config,
144+env: {},
145+});
146+147+collectPluginConfigAssignments({
148+ config,
149+defaults: undefined,
150+ context,
151+loadablePluginOrigins: new Map([["google-meet", "config"]]),
152+});
153+154+expect({
155+assignments: context.assignments.map((assignment) => assignment.path).toSorted(),
156+warnings: context.warnings,
157+}).toEqual({
158+assignments: [
159+"plugins.entries.google-meet.config.realtime.providers.google.apiKey",
160+"plugins.entries.google-meet.config.realtime.providers.openai.apiKey",
161+],
162+warnings: [],
163+});
164+});
107165});
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。