





















@@ -433,20 +433,36 @@ function assertConfiguredPluginInstalls() {
433433}
434434const index = readInstalledPluginIndex();
435435const records = index.installRecords ?? {};
436-const matrix = records.matrix;
437-const bundledMatrix = (index.plugins ?? []).find((plugin) => plugin?.pluginId === "matrix");
438-if (matrix) {
439-assertExternalPluginInstall(records, "matrix", "@openclaw/matrix");
440-} else if (bundledMatrix) {
441-assert(bundledMatrix.enabled !== false, "configured bundled matrix plugin is disabled");
442-}
443-const brave = (index.plugins ?? []).find((plugin) => plugin?.pluginId === "brave");
444-assert(brave, "configured external brave plugin is missing from the plugin index");
445-assert(brave.enabled !== false, "configured external brave plugin is disabled");
446-assertExternalPluginInstall(records, "brave", "@openclaw/brave-plugin");
436+assertOptionalConfiguredPluginIndex(records, index.plugins ?? [], {
437+bundled: true,
438+packageName: "@openclaw/matrix",
439+pluginId: "matrix",
440+});
441+assertOptionalConfiguredPluginIndex(records, index.plugins ?? [], {
442+packageName: "@openclaw/brave-plugin",
443+pluginId: "brave",
444+});
447445assert(!records.telegram, "internal telegram plugin should not be installed externally");
448446}
449447448+function assertOptionalConfiguredPluginIndex(
449+records,
450+plugins,
451+{ bundled = false, packageName, pluginId },
452+) {
453+const record = records[pluginId];
454+const plugin = plugins.find((entry) => entry?.pluginId === pluginId);
455+if (record) {
456+assertExternalPluginInstall(records, pluginId, packageName);
457+}
458+if (plugin) {
459+assert(
460+plugin.enabled !== false,
461+`configured ${bundled ? "bundled" : "external"} ${pluginId} plugin is disabled`,
462+);
463+}
464+}
465+450466function assertStatusJson([file]) {
451467const status = readJson(file);
452468assert(status && typeof status === "object", "gateway status JSON was not an object");
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。