

























@@ -159,20 +159,41 @@ function makeSkipInstallPrompter() {
159159return { prompter, select };
160160}
161161162+function makeManifestRecord(plugin: {
163+id: string;
164+channels?: string[];
165+origin?: "bundled" | "global" | "workspace";
166+activation?: { onChannels?: string[] };
167+}) {
168+const rootDir = `/tmp/openclaw-plugins/${plugin.id}`;
169+return {
170+id: plugin.id,
171+origin: plugin.origin ?? "bundled",
172+channels: plugin.channels ?? [],
173+providers: [],
174+cliBackends: [],
175+hooks: [],
176+skills: [],
177+ rootDir,
178+source: path.join(rootDir, "index.js"),
179+manifestPath: path.join(rootDir, "openclaw.plugin.json"),
180+ ...(plugin.activation ? { activation: plugin.activation } : {}),
181+};
182+}
183+162184function mockActivationOnlyPlugin(plugin: {
163185id: string;
164186origin?: "bundled" | "global" | "workspace";
165187}) {
166188loadPluginManifestRegistry.mockReturnValue({
167189plugins: [
168-{
190+makeManifestRecord({
169191id: plugin.id,
170-channels: [],
171- ...(plugin.origin === undefined ? {} : { origin: plugin.origin }),
192+origin: plugin.origin,
172193activation: {
173194onChannels: ["external-chat"],
174195},
175-},
196+}),
176197],
177198diagnostics: [],
178199});
@@ -746,7 +767,12 @@ describe("ensureChannelSetupPluginInstalled", () => {
746767const runtime = makeRuntime();
747768const cfg: OpenClawConfig = {};
748769loadPluginManifestRegistry.mockReturnValue({
749-plugins: [{ id: "custom-external-chat-plugin", channels: ["external-chat"] }],
770+plugins: [
771+makeManifestRecord({
772+id: "custom-external-chat-plugin",
773+channels: ["external-chat"],
774+}),
775+],
750776diagnostics: [],
751777});
752778此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。