Skip to content

fix: replace broken stringEnum import with inline equivalent#32

Closed
GodsBoy wants to merge 1 commit intosupermemoryai:mainfrom
GodsBoy:fix/stringEnum-import-crash
Closed

fix: replace broken stringEnum import with inline equivalent#32
GodsBoy wants to merge 1 commit intosupermemoryai:mainfrom
GodsBoy:fix/stringEnum-import-crash

Conversation

@GodsBoy
Copy link
Copy Markdown

@GodsBoy GodsBoy commented Mar 23, 2026

Summary

  • Replace the broken stringEnum import from openclaw/plugin-sdk with an inline equivalent using Type.Union + Type.Literal from @sinclair/typebox
  • stringEnum is declared in the plugin-sdk type definitions but is not available as a runtime export, causing the plugin to crash on register with TypeError: (0 , _pluginSdk.stringEnum) is not a function
  • The inline function produces identical schema output without depending on the plugin-sdk internal

Fixes #31

Test plan

  • Verified the fix locally — plugin registers and starts without errors
  • stringEnum(MEMORY_CATEGORIES) produces the same Type.Union schema as before
  • No other files reference stringEnum — this is the only call site

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 supermemoryai#31
@MaheshtheDev
Copy link
Copy Markdown
Member

just package import change would have been simple, anyways changes are already merged. thanks for the contribution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: stringEnum import from plugin-sdk crashes on register (v2.0.2)

2 participants