const CAPABILITY_METHOD_PAIRS = [
  { flag: "reactions", method: "sendReaction" },
  { flag: "reactions", method: "removeReaction" },
  { flag: "editMessage", method: "editMessage" },
  { flag: "deleteMessage", method: "deleteMessage" },
  { flag: "conversationHistory", method: "fetchHistory" }
];
function validateAdapterCapabilities(adapter) {
  if (!adapter.providerKey) {
    throw new Error("ChannelAdapter is missing required `providerKey` property");
  }
  if (!adapter.channelType) {
    throw new Error(
      `ChannelAdapter '${adapter.providerKey}' is missing required \`channelType\` property`
    );
  }
  if (!adapter.capabilities) {
    throw new Error(
      `ChannelAdapter '${adapter.providerKey}' is missing required \`capabilities\` property`
    );
  }
  for (const pair of CAPABILITY_METHOD_PAIRS) {
    const flagSet = adapter.capabilities[pair.flag] === true;
    if (!flagSet) continue;
    const method = adapter[pair.method];
    if (typeof method !== "function") {
      throw new Error(
        `ChannelAdapter '${adapter.providerKey}' declares capabilities.${String(pair.flag)}=true but does not implement ${String(pair.method)}()`
      );
    }
  }
}
export {
  validateAdapterCapabilities
};
//# sourceMappingURL=adapter-compat.js.map
