mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-25 08:02:04 +00:00
refactor(plugin-sdk): genericize web channel runtime seams
This commit is contained in:
@@ -151,6 +151,19 @@ describe("plugin-sdk subpath exports", () => {
|
||||
}
|
||||
});
|
||||
|
||||
it("keeps removed bundled-channel prefixes out of the public sdk list", () => {
|
||||
const bannedPrefixes = ["discord", "signal", "slack", "telegram", "whatsapp"];
|
||||
const banned = pluginSdkSubpaths.filter((subpath) =>
|
||||
bannedPrefixes.some(
|
||||
(prefix) =>
|
||||
subpath === prefix ||
|
||||
subpath.startsWith(`${prefix}-`) ||
|
||||
subpath.startsWith(`${prefix}.`),
|
||||
),
|
||||
);
|
||||
expect(banned).toEqual([]);
|
||||
});
|
||||
|
||||
it("keeps helper subpaths aligned", () => {
|
||||
expectSourceMentions("core", [
|
||||
"emptyPluginConfigSchema",
|
||||
@@ -468,8 +481,10 @@ describe("plugin-sdk subpath exports", () => {
|
||||
"applyChannelMatchMeta",
|
||||
"buildChannelKeyCandidates",
|
||||
"buildMessagingTarget",
|
||||
"ChannelId",
|
||||
"createAllowedChatSenderMatcher",
|
||||
"ensureTargetId",
|
||||
"normalizeChannelId",
|
||||
"parseChatAllowTargetPrefixes",
|
||||
"parseMentionPrefixOrAtUserTarget",
|
||||
"parseChatTargetPrefixesOrThrow",
|
||||
@@ -775,6 +790,7 @@ describe("plugin-sdk subpath exports", () => {
|
||||
"createChannelPairingChallengeIssuer",
|
||||
"createLoggedPairingApprovalNotifier",
|
||||
"createPairingPrefixStripper",
|
||||
"readChannelAllowFromStoreSync",
|
||||
"createTextPairingAdapter",
|
||||
]);
|
||||
expect("createScopedPairingAccess" in channelPairingSdk).toBe(false);
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { createJiti } from "jiti";
|
||||
type WhatsAppHeavyRuntimeModule = typeof import("@openclaw/whatsapp/runtime-api.js");
|
||||
type WhatsAppLightRuntimeModule = typeof import("@openclaw/whatsapp/light-runtime-api.js");
|
||||
import { resolveWhatsAppHeartbeatRecipients } from "../../channels/plugins/whatsapp-heartbeat.js";
|
||||
import {
|
||||
getDefaultLocalRoots as getDefaultLocalRootsImpl,
|
||||
loadWebMedia as loadWebMediaImpl,
|
||||
@@ -281,7 +280,7 @@ export function getDefaultLocalRoots(
|
||||
}
|
||||
|
||||
export function resolveHeartbeatRecipients(
|
||||
...args: Parameters<typeof resolveWhatsAppHeartbeatRecipients>
|
||||
): ReturnType<typeof resolveWhatsAppHeartbeatRecipients> {
|
||||
return resolveWhatsAppHeartbeatRecipients(...args);
|
||||
...args: Parameters<WhatsAppHeavyRuntimeModule["resolveHeartbeatRecipients"]>
|
||||
): ReturnType<WhatsAppHeavyRuntimeModule["resolveHeartbeatRecipients"]> {
|
||||
return loadCurrentHeavyModuleSync().resolveHeartbeatRecipients(...args);
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
export { createRuntimeWhatsAppLoginTool } from "./runtime-whatsapp-boundary.js";
|
||||
Reference in New Issue
Block a user