feat(plugins): add memory slot plugin

This commit is contained in:
Peter Steinberger
2026-01-18 02:12:01 +00:00
parent 005b831023
commit 9fd9f4c896
15 changed files with 244 additions and 14 deletions

View File

@@ -0,0 +1,37 @@
import type { ClawdbotPluginApi } from "../../src/plugins/types.js";
import { createMemoryGetTool, createMemorySearchTool } from "../../src/agents/tools/memory-tool.js";
import { registerMemoryCli } from "../../src/cli/memory-cli.js";
const memoryCorePlugin = {
id: "memory-core",
name: "Memory (Core)",
description: "File-backed memory search tools and CLI",
kind: "memory",
register(api: ClawdbotPluginApi) {
api.registerTool(
(ctx) => {
const memorySearchTool = createMemorySearchTool({
config: ctx.config,
agentSessionKey: ctx.sessionKey,
});
const memoryGetTool = createMemoryGetTool({
config: ctx.config,
agentSessionKey: ctx.sessionKey,
});
if (!memorySearchTool || !memoryGetTool) return null;
return [memorySearchTool, memoryGetTool];
},
{ names: ["memory_search", "memory_get"] },
);
api.registerCli(
({ program }) => {
registerMemoryCli(program);
},
{ commands: ["memory"] },
);
},
};
export default memoryCorePlugin;