refactor: route channel runtime via plugin api

This commit is contained in:
Peter Steinberger
2026-01-18 11:00:19 +00:00
parent 676d41d415
commit ee6e534ccb
82 changed files with 1253 additions and 3167 deletions

View 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);
}
});
});