melbot / src /plugin-sdk /index.test.ts
amos-fernandes's picture
Upload 4501 files
3a65265 verified
import { describe, expect, it } from "vitest";
import * as sdk from "./index.js";
describe("plugin-sdk exports", () => {
it("does not expose runtime modules", () => {
const forbidden = [
"chunkMarkdownText",
"chunkText",
"resolveTextChunkLimit",
"hasControlCommand",
"isControlCommandMessage",
"shouldComputeCommandAuthorized",
"shouldHandleTextCommands",
"buildMentionRegexes",
"matchesMentionPatterns",
"resolveStateDir",
"loadConfig",
"writeConfigFile",
"runCommandWithTimeout",
"enqueueSystemEvent",
"fetchRemoteMedia",
"saveMediaBuffer",
"formatAgentEnvelope",
"buildPairingReply",
"resolveAgentRoute",
"dispatchReplyFromConfig",
"createReplyDispatcherWithTyping",
"dispatchReplyWithBufferedBlockDispatcher",
"resolveCommandAuthorizedFromAuthorizers",
"monitorSlackProvider",
"monitorTelegramProvider",
"monitorIMessageProvider",
"monitorSignalProvider",
"sendMessageSlack",
"sendMessageTelegram",
"sendMessageIMessage",
"sendMessageSignal",
"sendMessageWhatsApp",
"probeSlack",
"probeTelegram",
"probeIMessage",
"probeSignal",
];
for (const key of forbidden) {
expect(Object.prototype.hasOwnProperty.call(sdk, key)).toBe(false);
}
});
});