mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-27 09:21:35 +07:00
fix: export shared channel action enum helpers
This commit is contained in:
@@ -1,11 +1,5 @@
|
||||
import { Type } from "@sinclair/typebox";
|
||||
|
||||
function stringEnum<T extends readonly string[]>(values: T) {
|
||||
return Type.Unsafe<T[number]>({
|
||||
type: "string",
|
||||
enum: [...values],
|
||||
});
|
||||
}
|
||||
import { stringEnum } from "openclaw/plugin-sdk/channel-actions";
|
||||
|
||||
const discordComponentEmojiSchema = Type.Object({
|
||||
name: Type.String(),
|
||||
|
||||
@@ -3,6 +3,7 @@ export {
|
||||
listTokenSourcedAccounts,
|
||||
} from "../channels/plugins/actions/shared.js";
|
||||
export { resolveReactionMessageId } from "../channels/plugins/actions/reaction-message-id.js";
|
||||
export { optionalStringEnum, stringEnum } from "../agents/schema/typebox.js";
|
||||
import { Type } from "@sinclair/typebox";
|
||||
import type { TSchema } from "@sinclair/typebox";
|
||||
import { stringEnum } from "../agents/schema/typebox.js";
|
||||
|
||||
@@ -203,6 +203,7 @@ describe("plugin-sdk subpath exports", () => {
|
||||
],
|
||||
});
|
||||
expectSourceMentions("account-helpers", ["createAccountListHelpers"]);
|
||||
expectSourceMentions("channel-actions", ["optionalStringEnum", "stringEnum"]);
|
||||
expectSourceMentions("device-bootstrap", [
|
||||
"approveDevicePairing",
|
||||
"issueDeviceBootstrapToken",
|
||||
@@ -583,6 +584,7 @@ describe("plugin-sdk subpath exports", () => {
|
||||
it("keeps runtime entry subpaths importable", async () => {
|
||||
const [
|
||||
coreSdk,
|
||||
channelActionsSdk,
|
||||
textRuntimeSdk,
|
||||
pluginEntrySdk,
|
||||
channelLifecycleSdk,
|
||||
@@ -591,6 +593,7 @@ describe("plugin-sdk subpath exports", () => {
|
||||
...representativeModules
|
||||
] = await Promise.all([
|
||||
importResolvedPluginSdkSubpath("openclaw/plugin-sdk/core"),
|
||||
importResolvedPluginSdkSubpath("openclaw/plugin-sdk/channel-actions"),
|
||||
importResolvedPluginSdkSubpath("openclaw/plugin-sdk/text-runtime"),
|
||||
importResolvedPluginSdkSubpath("openclaw/plugin-sdk/plugin-entry"),
|
||||
importResolvedPluginSdkSubpath("openclaw/plugin-sdk/channel-lifecycle"),
|
||||
@@ -603,6 +606,8 @@ describe("plugin-sdk subpath exports", () => {
|
||||
|
||||
expect(coreSdk.definePluginEntry).toBe(pluginEntrySdk.definePluginEntry);
|
||||
expect(typeof coreSdk.optionalStringEnum).toBe("function");
|
||||
expect(typeof channelActionsSdk.optionalStringEnum).toBe("function");
|
||||
expect(typeof channelActionsSdk.stringEnum).toBe("function");
|
||||
expect(typeof textRuntimeSdk.createScopedExpiringIdCache).toBe("function");
|
||||
expect(typeof textRuntimeSdk.resolveGlobalMap).toBe("function");
|
||||
expect(typeof textRuntimeSdk.resolveGlobalSingleton).toBe("function");
|
||||
|
||||
Reference in New Issue
Block a user