From 0a3590d6e9eb8f95bf318b170bef62e45f6475b2 Mon Sep 17 00:00:00 2001 From: GodsBoy Date: Mon, 23 Mar 2026 14:37:15 +0200 Subject: [PATCH] fix: replace broken stringEnum import with inline equivalent stringEnum is declared in openclaw/plugin-sdk type definitions but is not exported at runtime, causing a TypeError on plugin register: TypeError: (0 , _pluginSdk.stringEnum) is not a function Replace the import with an inline equivalent using Type.Union + Type.Literal from @sinclair/typebox (already a dependency). This produces the same schema output without depending on the plugin-sdk internal export. Fixes #31 --- tools/store.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tools/store.ts b/tools/store.ts index 0d1b93b..62776ab 100644 --- a/tools/store.ts +++ b/tools/store.ts @@ -1,6 +1,5 @@ import { Type } from "@sinclair/typebox" import type { OpenClawPluginApi } from "openclaw/plugin-sdk" -import { stringEnum } from "openclaw/plugin-sdk" import type { SupermemoryClient } from "../client.ts" import type { SupermemoryConfig } from "../config.ts" import { log } from "../logger.ts" @@ -10,6 +9,12 @@ import { MEMORY_CATEGORIES, } from "../memory.ts" +// stringEnum is declared in plugin-sdk types but not exported at runtime, +// so we inline the equivalent using Type.Union + Type.Literal. +function stringEnum(values: readonly T[]) { + return Type.Union(values.map((v) => Type.Literal(v))) +} + export function registerStoreTool( api: OpenClawPluginApi, client: SupermemoryClient,