Skip to content

Fix: stringEnum import path#33

Merged
MaheshtheDev merged 1 commit intosupermemoryai:mainfrom
Mind-Dragon:fix/stringenum-import
Mar 24, 2026
Merged

Fix: stringEnum import path#33
MaheshtheDev merged 1 commit intosupermemoryai:mainfrom
Mind-Dragon:fix/stringenum-import

Conversation

@Mind-Dragon
Copy link
Copy Markdown

Prompt: Fix TypeError where stringEnum is not a function by correcting the import path from "openclaw/plugin-sdk" to "openclaw/plugin-sdk/core"

Problem:
```
TypeError: (0 , _pluginSdk.stringEnum) is not a function
```

The plugin fails to register because `stringEnum` is not exported from the main `openclaw/plugin-sdk` entry point. It's available in `openclaw/plugin-sdk/core`.

Fix:
Changed both imports in `tools/store.ts` to use `openclaw/plugin-sdk/core`.

Testing:
Verified the plugin now loads successfully without the TypeError.

Copilot AI review requested due to automatic review settings March 23, 2026 15:56
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses a runtime plugin registration failure caused by importing stringEnum from the wrong OpenClaw SDK entry point, updating the import to use openclaw/plugin-sdk/core where stringEnum is actually exported.

Changes:

  • Update imports in tools/store.ts to pull stringEnum (and OpenClawPluginApi) from openclaw/plugin-sdk/core to avoid the runtime TypeError.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

tools/store.ts Outdated
import { Type } from "@sinclair/typebox"
import type { OpenClawPluginApi } from "openclaw/plugin-sdk"
import { stringEnum } from "openclaw/plugin-sdk"
import type { OpenClawPluginApi } from "openclaw/plugin-sdk/core"
Copy link

Copilot AI Mar 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OpenClawPluginApi is now imported from openclaw/plugin-sdk/core, but this repo’s local type shim only declares module "openclaw/plugin-sdk" (see types/openclaw.d.ts). With openclaw as a peerDependency, tsc --noEmit will likely fail with “Cannot find module 'openclaw/plugin-sdk/core' or its corresponding type declarations.” Consider keeping the type-only import from openclaw/plugin-sdk (it doesn’t affect runtime) and only switching the runtime stringEnum import to /core, or add a matching declare module "openclaw/plugin-sdk/core" type shim.

Suggested change
import type { OpenClawPluginApi } from "openclaw/plugin-sdk/core"
import type { OpenClawPluginApi } from "openclaw/plugin-sdk"

Copilot uses AI. Check for mistakes.
stringEnum is exported from openclaw/plugin-sdk/core, not openclaw/plugin-sdk.
This was causing TypeError: (0 , _pluginSdk.stringEnum) is not a function
when the plugin tried to register.
@Mind-Dragon Mind-Dragon force-pushed the fix/stringenum-import branch from e0ef458 to a268e6b Compare March 23, 2026 16:47
@MaheshtheDev
Copy link
Copy Markdown
Member

@claude can you review this PR

Copy link
Copy Markdown
Member

@MaheshtheDev MaheshtheDev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for contribution

@MaheshtheDev MaheshtheDev merged commit 1eda42c into supermemoryai:main Mar 24, 2026
1 check failed
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.

3 participants