Add registerMemoryPromptSection to the plugin API so the active memory plugin provides its own system prompt builder callback. The built-in memory-core plugin registers the existing Memory Recall section via this new API. When no memory plugin is active (or a plugin does not register a builder), the memory section is simply omitted from the system prompt. This lets third-party memory plugins inject their own guidance at the same position in the prompt.
34 lines
1023 B
TypeScript
34 lines
1023 B
TypeScript
import type { OpenClawPluginApi } from "openclaw/plugin-sdk/plugin-runtime";
|
|
|
|
type TestPluginApiInput = Partial<OpenClawPluginApi> &
|
|
Pick<OpenClawPluginApi, "id" | "name" | "source" | "config" | "runtime">;
|
|
|
|
export function createTestPluginApi(api: TestPluginApiInput): OpenClawPluginApi {
|
|
return {
|
|
registrationMode: "full",
|
|
logger: { info() {}, warn() {}, error() {}, debug() {} },
|
|
registerTool() {},
|
|
registerHook() {},
|
|
registerHttpRoute() {},
|
|
registerChannel() {},
|
|
registerGatewayMethod() {},
|
|
registerCli() {},
|
|
registerService() {},
|
|
registerProvider() {},
|
|
registerSpeechProvider() {},
|
|
registerMediaUnderstandingProvider() {},
|
|
registerImageGenerationProvider() {},
|
|
registerWebSearchProvider() {},
|
|
registerInteractiveHandler() {},
|
|
onConversationBindingResolved() {},
|
|
registerCommand() {},
|
|
registerContextEngine() {},
|
|
registerMemoryPromptSection() {},
|
|
resolvePath(input: string) {
|
|
return input;
|
|
},
|
|
on() {},
|
|
...api,
|
|
};
|
|
}
|