import type {
ChannelDoctorConfigMutation,
ChannelDoctorLegacyConfigRule,
} from "openclaw/plugin-sdk/channel-contract"; import type { OpenClawConfig } from "openclaw/plugin-sdk/config-runtime"; import { asObjectRecord } from "openclaw/plugin-sdk/runtime-doctor";
type GoogleChatChannelsConfig = NonNullable<OpenClawConfig["channels"]>;
function hasLegacyGoogleChatStreamMode(value: unknown): boolean { return asObjectRecord(value)?.streamMode !== undefined;
}
function hasLegacyGoogleChatGroupAllowAlias(value: unknown): boolean { const groups = asObjectRecord(asObjectRecord(value)?.groups); if (!groups) { returnfalse;
} return Object.values(groups).some((group) =>
Object.prototype.hasOwnProperty.call(asObjectRecord(group) ?? {}, "allow"),
);
}
export const legacyConfigRules: ChannelDoctorLegacyConfigRule[] = [
{
path: ["channels", "googlechat"],
message: "channels.googlechat.streamMode is legacy and no longer used; it is removed on load.",
match: hasLegacyGoogleChatStreamMode,
},
{
path: ["channels", "googlechat", "accounts"],
message: "channels.googlechat.accounts.<id>.streamMode is legacy and no longer used; it is removed on load.",
match: (value) => hasLegacyAccountAliases(value, hasLegacyGoogleChatStreamMode),
},
{
path: ["channels", "googlechat"],
message: 'channels.googlechat.groups.<id>.allow is legacy; use channels.googlechat.groups.<id>.enabled instead. Run "openclaw doctor --fix".',
match: hasLegacyGoogleChatGroupAllowAlias,
},
{
path: ["channels", "googlechat", "accounts"],
message: 'channels.googlechat.accounts.<id>.groups.<id>.allow is legacy; use channels.googlechat.accounts.<id>.groups.<id>.enabled instead. Run "openclaw doctor --fix".',
match: (value) => hasLegacyAccountAliases(value, hasLegacyGoogleChatGroupAllowAlias),
},
];
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.