refactor: route channel runtime via plugin api

This commit is contained in:
Peter Steinberger
2026-01-18 11:00:19 +00:00
parent 676d41d415
commit ee6e534ccb
82 changed files with 1253 additions and 3167 deletions

View File

@@ -1,11 +1,5 @@
import type { ClawdbotPluginApi } from "clawdbot/plugin-sdk";
import {
createMemoryGetTool,
createMemorySearchTool,
registerMemoryCli,
} from "clawdbot/plugin-sdk";
const memoryCorePlugin = {
id: "memory-core",
name: "Memory (Core)",
@@ -14,11 +8,11 @@ const memoryCorePlugin = {
register(api: ClawdbotPluginApi) {
api.registerTool(
(ctx) => {
const memorySearchTool = createMemorySearchTool({
const memorySearchTool = api.runtime.tools.createMemorySearchTool({
config: ctx.config,
agentSessionKey: ctx.sessionKey,
});
const memoryGetTool = createMemoryGetTool({
const memoryGetTool = api.runtime.tools.createMemoryGetTool({
config: ctx.config,
agentSessionKey: ctx.sessionKey,
});
@@ -30,7 +24,7 @@ const memoryCorePlugin = {
api.registerCli(
({ program }) => {
registerMemoryCli(program);
api.runtime.tools.registerMemoryCli(program);
},
{ commands: ["memory"] },
);