mr-memory 1.0.3 → 1.0.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.
Files changed (2) hide show
  1. package/index.ts +25 -7
  2. package/package.json +1 -1
package/index.ts CHANGED
@@ -73,7 +73,7 @@ const memoryRouterPlugin = {
73
73
  if (memoryKey) {
74
74
  api.logger.info?.(`memoryrouter: registered (endpoint: ${endpoint})`);
75
75
  } else {
76
- api.logger.info?.("memoryrouter: no key configured — run: openclaw mr enable <key>");
76
+ api.logger.info?.("memoryrouter: no key configured — run: openclaw mr <key>");
77
77
  }
78
78
 
79
79
  if (memoryKey) {
@@ -118,10 +118,28 @@ const memoryRouterPlugin = {
118
118
 
119
119
  api.registerCli(
120
120
  ({ program }) => {
121
- const mr = program.command("mr").description("MemoryRouter memory commands");
121
+ const mr = program.command("mr")
122
+ .description("MemoryRouter memory commands")
123
+ .argument("[key]", "Your MemoryRouter memory key (mk_xxx)")
124
+ .action(async (key: string | undefined) => {
125
+ if (!key) {
126
+ // No key provided — show help
127
+ mr.help();
128
+ return;
129
+ }
130
+ if (!key.startsWith("mk")) {
131
+ console.error("Invalid key format. Keys start with 'mk' (e.g. mk_xxx)");
132
+ return;
133
+ }
134
+ await api.updatePluginConfig({ key });
135
+ await api.updatePluginEnabled(true);
136
+ console.log(`✓ MemoryRouter enabled. Key: ${key.slice(0, 6)}...${key.slice(-3)}`);
137
+ console.log(`\nRun: openclaw mr upload to upload your memories`);
138
+ });
122
139
 
140
+ // Backward compat: `openclaw mr enable <key>` still works
123
141
  mr.command("enable")
124
- .description("Enable MemoryRouter with a memory key")
142
+ .description("Enable MemoryRouter with a memory key (alias)")
125
143
  .argument("<key>", "Your MemoryRouter memory key (mk_xxx)")
126
144
  .action(async (key: string) => {
127
145
  if (!key.startsWith("mk")) {
@@ -139,7 +157,7 @@ const memoryRouterPlugin = {
139
157
  .action(async () => {
140
158
  await api.updatePluginConfig({});
141
159
  console.log("✓ MemoryRouter disabled. LLM calls go direct to provider.");
142
- console.log(" Key removed. Re-enable with: openclaw mr enable <key>");
160
+ console.log(" Key removed. Re-enable with: openclaw mr <key>");
143
161
  });
144
162
 
145
163
  mr.command("status")
@@ -147,7 +165,7 @@ const memoryRouterPlugin = {
147
165
  .option("--json", "JSON output")
148
166
  .action(async (opts) => {
149
167
  if (!memoryKey) {
150
- console.error("MemoryRouter not configured. Run: openclaw mr enable <key>");
168
+ console.error("MemoryRouter not configured. Run: openclaw mr <key>");
151
169
  return;
152
170
  }
153
171
  try {
@@ -182,7 +200,7 @@ const memoryRouterPlugin = {
182
200
  .option("--brain <dir>", "State directory with sessions (default: ~/.openclaw)")
183
201
  .action(async (targetPath: string | undefined, opts: { workspace?: string; brain?: string }) => {
184
202
  if (!memoryKey) {
185
- console.error("MemoryRouter not configured. Run: openclaw mr enable <key>");
203
+ console.error("MemoryRouter not configured. Run: openclaw mr <key>");
186
204
  return;
187
205
  }
188
206
  const os = await import("node:os");
@@ -211,7 +229,7 @@ const memoryRouterPlugin = {
211
229
  .description("Clear all memories from vault")
212
230
  .action(async () => {
213
231
  if (!memoryKey) {
214
- console.error("MemoryRouter not configured. Run: openclaw mr enable <key>");
232
+ console.error("MemoryRouter not configured. Run: openclaw mr <key>");
215
233
  return;
216
234
  }
217
235
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mr-memory",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
4
4
  "description": "MemoryRouter persistent memory plugin for OpenClaw — your AI remembers every conversation",
5
5
  "type": "module",
6
6
  "keywords": [