mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-12 17:51:22 +00:00
fix: stabilize contract loader seams
This commit is contained in:
@@ -41,10 +41,9 @@ const sendMessageMatrixMock = vi.hoisted(() =>
|
||||
roomId: to.replace(/^room:/, ""),
|
||||
})),
|
||||
);
|
||||
const matrixRuntimeApiModuleId = new URL(
|
||||
"../../../../extensions/matrix/runtime-api.js",
|
||||
import.meta.url,
|
||||
).href;
|
||||
const matrixRuntimeApiModuleId = vi.hoisted(
|
||||
() => new URL("../../../../extensions/matrix/runtime-api.js", import.meta.url).href,
|
||||
);
|
||||
|
||||
const lineContractApi = await importBundledChannelContractArtifact<{
|
||||
listLineAccountIds: () => string[];
|
||||
|
||||
@@ -1,11 +1,19 @@
|
||||
// Manual facade. Keep loader boundary explicit.
|
||||
type FacadeModule = typeof import("@openclaw/mattermost/api.js");
|
||||
type MattermostSenderAllowed = (params: {
|
||||
senderId: string;
|
||||
senderName?: string;
|
||||
allowFrom: string[];
|
||||
allowNameMatching?: boolean;
|
||||
}) => boolean;
|
||||
type FacadeModule = {
|
||||
isMattermostSenderAllowed: MattermostSenderAllowed;
|
||||
};
|
||||
import { loadBundledPluginPublicSurfaceModuleSync } from "./facade-runtime.js";
|
||||
|
||||
function loadFacadeModule(): FacadeModule {
|
||||
return loadBundledPluginPublicSurfaceModuleSync<FacadeModule>({
|
||||
dirName: "mattermost",
|
||||
artifactBasename: "api.js",
|
||||
artifactBasename: "policy-api.js",
|
||||
});
|
||||
}
|
||||
export const isMattermostSenderAllowed: FacadeModule["isMattermostSenderAllowed"] = ((...args) =>
|
||||
|
||||
Reference in New Issue
Block a user