MAESTRO: Fix OpenClaw SDK API mismatch — use real PluginApi interface

E2E testing against the official OpenClaw Docker image revealed the plugin
was built against a custom interface that didn't match the real SDK:
- api.log() → api.logger.info/warn/error() (PluginLogger interface)
- api.getConfig() → api.pluginConfig (direct property)
- command handler (args[], ctx) → (ctx) with ctx.args string
- service stop optional, service context typed

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Alex Newman
2026-02-07 21:28:08 -05:00
parent db207807cb
commit 1b9f601c41
3 changed files with 93 additions and 38 deletions
+11 -3
View File
@@ -12,9 +12,17 @@ let registeredCommand = null;
const logs = [];
const mockApi = {
getConfig: () => ({}),
log: (message) => {
logs.push(message);
id: "claude-mem",
name: "Claude-Mem (Persistent Memory)",
version: "1.0.0",
source: "/test/extensions/claude-mem/dist/index.js",
config: {},
pluginConfig: {},
logger: {
info: (message) => { logs.push(message); },
warn: (message) => { logs.push(message); },
error: (message) => { logs.push(message); },
debug: (message) => { logs.push(message); },
},
registerService: (service) => {
registeredService = service;