mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-13 00:02:55 +00:00
refactor: route channel runtime via plugin api
This commit is contained in:
51
src/plugin-sdk/index.test.ts
Normal file
51
src/plugin-sdk/index.test.ts
Normal file
@@ -0,0 +1,51 @@
|
||||
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",
|
||||
"detectMime",
|
||||
"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);
|
||||
}
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user