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.
- package/index.ts +25 -7
- 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
|
|
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")
|
|
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
|
|
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
|
|
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
|
|
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
|
|
232
|
+
console.error("MemoryRouter not configured. Run: openclaw mr <key>");
|
|
215
233
|
return;
|
|
216
234
|
}
|
|
217
235
|
try {
|