mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-05 15:50:25 +00:00
Plugin SDK: consolidate shared channel exports
This commit is contained in:
@@ -19,6 +19,11 @@ import { describe, expect, expectTypeOf, it } from "vitest";
|
||||
import type { ChannelMessageActionContext } from "../channels/plugins/types.js";
|
||||
import type { PluginRuntime } from "../plugins/runtime/types.js";
|
||||
import type { OpenClawPluginApi } from "../plugins/types.js";
|
||||
import type {
|
||||
ChannelMessageActionContext as SharedChannelMessageActionContext,
|
||||
OpenClawPluginApi as SharedOpenClawPluginApi,
|
||||
PluginRuntime as SharedPluginRuntime,
|
||||
} from "./channel-plugin-common.js";
|
||||
import { pluginSdkSubpaths } from "./entrypoints.js";
|
||||
|
||||
const importPluginSdkSubpath = (specifier: string) => import(/* @vite-ignore */ specifier);
|
||||
@@ -49,6 +54,12 @@ describe("plugin-sdk subpath exports", () => {
|
||||
expectTypeOf<CoreChannelMessageActionContext>().toMatchTypeOf<ChannelMessageActionContext>();
|
||||
});
|
||||
|
||||
it("keeps core shared types aligned with the channel prelude", () => {
|
||||
expectTypeOf<CoreOpenClawPluginApi>().toMatchTypeOf<SharedOpenClawPluginApi>();
|
||||
expectTypeOf<CorePluginRuntime>().toMatchTypeOf<SharedPluginRuntime>();
|
||||
expectTypeOf<CoreChannelMessageActionContext>().toMatchTypeOf<SharedChannelMessageActionContext>();
|
||||
});
|
||||
|
||||
it("exports Discord helpers", () => {
|
||||
expect(typeof discordSdk.buildChannelConfigSchema).toBe("function");
|
||||
expect(typeof discordSdk.DiscordConfigSchema).toBe("object");
|
||||
|
||||
Reference in New Issue
Block a user