mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-02 13:30:22 +00:00
Plugin SDK: restore scoped imports for bundled channels
This commit is contained in:
@@ -53,6 +53,7 @@ export type {
|
||||
SshSandboxSettings,
|
||||
} from "../agents/sandbox.js";
|
||||
export type { ChannelPlugin } from "../channels/plugins/types.plugin.js";
|
||||
export type { ChannelMessageActionContext } from "../channels/plugins/types.js";
|
||||
export type { PluginRuntime } from "../plugins/runtime/types.js";
|
||||
export type { OpenClawConfig } from "../config/config.js";
|
||||
export type { GatewayRequestHandlerOptions } from "../gateway/server-methods/types.js";
|
||||
|
||||
@@ -1,6 +1,11 @@
|
||||
import * as extensionApi from "openclaw/extension-api";
|
||||
import * as compatSdk from "openclaw/plugin-sdk/compat";
|
||||
import * as coreSdk from "openclaw/plugin-sdk/core";
|
||||
import type {
|
||||
ChannelMessageActionContext as CoreChannelMessageActionContext,
|
||||
OpenClawPluginApi as CoreOpenClawPluginApi,
|
||||
PluginRuntime as CorePluginRuntime,
|
||||
} from "openclaw/plugin-sdk/core";
|
||||
import * as discordSdk from "openclaw/plugin-sdk/discord";
|
||||
import * as imessageSdk from "openclaw/plugin-sdk/imessage";
|
||||
import * as lineSdk from "openclaw/plugin-sdk/line";
|
||||
@@ -10,7 +15,10 @@ import * as signalSdk from "openclaw/plugin-sdk/signal";
|
||||
import * as slackSdk from "openclaw/plugin-sdk/slack";
|
||||
import * as telegramSdk from "openclaw/plugin-sdk/telegram";
|
||||
import * as whatsappSdk from "openclaw/plugin-sdk/whatsapp";
|
||||
import { describe, expect, it } from "vitest";
|
||||
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 { pluginSdkSubpaths } from "./entrypoints.js";
|
||||
|
||||
const importPluginSdkSubpath = (specifier: string) => import(/* @vite-ignore */ specifier);
|
||||
@@ -35,6 +43,12 @@ describe("plugin-sdk subpath exports", () => {
|
||||
expect(typeof coreSdk.createLoggerBackedRuntime).toBe("function");
|
||||
});
|
||||
|
||||
it("exports shared core types used by bundled channels", () => {
|
||||
expectTypeOf<CoreOpenClawPluginApi>().toMatchTypeOf<OpenClawPluginApi>();
|
||||
expectTypeOf<CorePluginRuntime>().toMatchTypeOf<PluginRuntime>();
|
||||
expectTypeOf<CoreChannelMessageActionContext>().toMatchTypeOf<ChannelMessageActionContext>();
|
||||
});
|
||||
|
||||
it("exports Discord helpers", () => {
|
||||
expect(typeof discordSdk.buildChannelConfigSchema).toBe("function");
|
||||
expect(typeof discordSdk.DiscordConfigSchema).toBe("object");
|
||||
|
||||
Reference in New Issue
Block a user