refactor: move memory tooling into memory-core extension

This commit is contained in:
Peter Steinberger
2026-03-26 21:58:21 +00:00
parent e0dfc776bb
commit e955d574b2
35 changed files with 136 additions and 2137 deletions

View File

@@ -72,7 +72,6 @@ describe("command-registry", () => {
it("returns only commands that support subcommands", () => {
const names = getCoreCliCommandsWithSubcommands();
expect(names).toContain("config");
expect(names).toContain("memory");
expect(names).toContain("agents");
expect(names).toContain("backup");
expect(names).toContain("browser");

View File

@@ -147,19 +147,6 @@ const coreEntries: CoreCliEntry[] = [
mod.registerMessageCommands(program, ctx);
},
},
{
commands: [
{
name: "memory",
description: "Search and reindex memory files",
hasSubcommands: true,
},
],
register: async ({ program }) => {
const mod = await import("../memory-cli.js");
mod.registerMemoryCli(program);
},
},
{
commands: [
{

View File

@@ -56,11 +56,6 @@ export const CORE_CLI_COMMAND_DESCRIPTORS = [
description: "Send, read, and manage messages",
hasSubcommands: true,
},
{
name: "memory",
description: "Search and reindex memory files",
hasSubcommands: true,
},
{
name: "agent",
description: "Run one agent turn via the Gateway",

View File

@@ -13,11 +13,17 @@ function buildRootHelpProgram(): Command {
agentChannelOptions: "",
});
const existingCommands = new Set<string>();
for (const command of getCoreCliCommandDescriptors()) {
program.command(command.name).description(command.description);
existingCommands.add(command.name);
}
for (const command of getSubCliEntries()) {
if (existingCommands.has(command.name)) {
continue;
}
program.command(command.name).description(command.description);
existingCommands.add(command.name);
}
return program;

View File

@@ -260,10 +260,6 @@ describe("program routes", () => {
);
});
it("returns false for memory status route when --agent value is missing", async () => {
await expectRunFalse(["memory", "status"], ["node", "openclaw", "memory", "status", "--agent"]);
});
it("returns false for models list route when --provider value is missing", async () => {
await expectRunFalse(["models", "list"], ["node", "openclaw", "models", "list", "--provider"]);
});

View File

@@ -151,23 +151,6 @@ const routeAgentsList: RouteSpec = {
},
};
const routeMemoryStatus: RouteSpec = {
match: (path) => path[0] === "memory" && path[1] === "status",
run: async (argv) => {
const agent = getFlagValue(argv, "--agent");
if (agent === null) {
return false;
}
const json = hasFlag(argv, "--json");
const deep = hasFlag(argv, "--deep");
const index = hasFlag(argv, "--index");
const verbose = hasFlag(argv, "--verbose");
const { runMemoryStatus } = await import("../memory-cli.js");
await runMemoryStatus({ agent, json, deep, index, verbose });
return true;
},
};
function getFlagValues(argv: string[], name: string): string[] | null {
const values: string[] = [];
const args = argv.slice(2);
@@ -316,7 +299,6 @@ const routes: RouteSpec[] = [
routeGatewayStatus,
routeSessions,
routeAgentsList,
routeMemoryStatus,
routeConfigGet,
routeConfigUnset,
routeModelsList,