@hasna/mementos 0.10.4 → 0.10.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/index.js +25 -0
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -10921,4 +10921,29 @@ program2.command("get-focus").description("Show the current project focus for an
|
|
|
10921
10921
|
else
|
|
10922
10922
|
console.log(chalk.dim("No focus set."));
|
|
10923
10923
|
});
|
|
10924
|
+
program2.command("remove <nameOrId>").description("Remove/delete a memory by name or ID (alias for memory delete)").option("--agent <id>", "Agent ID").action((nameOrId, opts) => {
|
|
10925
|
+
const globalOpts = program2.opts();
|
|
10926
|
+
const agentId = opts.agent || globalOpts.agent;
|
|
10927
|
+
const { deleteMemory: deleteMemory2, getMemoryByKey: getMemoryByKey2, resolvePartialMemoryId } = (init_memories(), __toCommonJS(exports_memories));
|
|
10928
|
+
let id = null;
|
|
10929
|
+
try {
|
|
10930
|
+
id = resolvePartialMemoryId?.(nameOrId) || null;
|
|
10931
|
+
} catch {}
|
|
10932
|
+
if (!id) {
|
|
10933
|
+
const mem = getMemoryByKey2?.(nameOrId, agentId);
|
|
10934
|
+
if (mem)
|
|
10935
|
+
id = mem.id;
|
|
10936
|
+
}
|
|
10937
|
+
if (!id) {
|
|
10938
|
+
console.error(chalk.red(`Memory not found: ${nameOrId}`));
|
|
10939
|
+
process.exit(1);
|
|
10940
|
+
}
|
|
10941
|
+
const deleted = deleteMemory2(id);
|
|
10942
|
+
if (deleted)
|
|
10943
|
+
console.log(chalk.green(`\u2713 Memory ${id.slice(0, 8)} removed`));
|
|
10944
|
+
else {
|
|
10945
|
+
console.error(chalk.red(`Memory not found: ${nameOrId}`));
|
|
10946
|
+
process.exit(1);
|
|
10947
|
+
}
|
|
10948
|
+
});
|
|
10924
10949
|
program2.parse(process.argv);
|