fix: export shared channel action enum helpers

This commit is contained in:
Peter Steinberger
2026-03-26 21:21:44 +00:00
parent 0c0f1e34cb
commit 6aa9bec8d7
3 changed files with 7 additions and 7 deletions

View File

@@ -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(),

View File

@@ -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";

View File

@@ -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");