@memoryrelay/plugin-memoryrelay-ai 0.8.1 → 0.8.2
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 +41 -4
- package/package.json +1 -1
package/index.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* OpenClaw Memory Plugin - MemoryRelay
|
|
3
|
-
* Version: 0.8.
|
|
3
|
+
* Version: 0.8.2 (Enhanced Gateway Logging)
|
|
4
4
|
*
|
|
5
5
|
* Long-term memory with vector search using MemoryRelay API.
|
|
6
6
|
* Provides auto-recall and auto-capture via lifecycle hooks.
|
|
@@ -9,6 +9,12 @@
|
|
|
9
9
|
* API: https://api.memoryrelay.net
|
|
10
10
|
* Docs: https://memoryrelay.ai
|
|
11
11
|
*
|
|
12
|
+
* ENHANCEMENTS (v0.8.2):
|
|
13
|
+
* - Human-readable gateway logs with memory previews
|
|
14
|
+
* - Show similarity scores and memory snippets during auto-recall
|
|
15
|
+
* - Performance indicators (✓/✗ and timing with SLOW warnings)
|
|
16
|
+
* - Cleaner error messages in gateway logs
|
|
17
|
+
*
|
|
12
18
|
* ENHANCEMENTS (v0.8.0):
|
|
13
19
|
* - Debug mode with comprehensive API call logging
|
|
14
20
|
* - Enhanced status reporting with tool breakdown
|
|
@@ -234,6 +240,14 @@ class MemoryRelayClient {
|
|
|
234
240
|
retries: retryCount,
|
|
235
241
|
requestBody: this.debugLogger && body ? body : undefined,
|
|
236
242
|
});
|
|
243
|
+
|
|
244
|
+
// Enhanced gateway logging (v0.8.2): Readable error summary
|
|
245
|
+
if (this.config.debug && this.api) {
|
|
246
|
+
const retryMsg = retryCount > 0 ? ` (retry ${retryCount}/${MAX_RETRIES})` : '';
|
|
247
|
+
this.api.logger.warn?.(
|
|
248
|
+
`memory-memoryrelay: ${toolName} → ${response.status} ${errorMsg || response.statusText}${retryMsg}`
|
|
249
|
+
);
|
|
250
|
+
}
|
|
237
251
|
}
|
|
238
252
|
|
|
239
253
|
// Track failure
|
|
@@ -267,6 +281,15 @@ class MemoryRelayClient {
|
|
|
267
281
|
requestBody: this.debugLogger && body ? body : undefined,
|
|
268
282
|
responseBody: this.debugLogger && result ? result : undefined,
|
|
269
283
|
});
|
|
284
|
+
|
|
285
|
+
// Enhanced gateway logging (v0.8.2): Readable API call summary
|
|
286
|
+
if (this.config.debug && this.api) {
|
|
287
|
+
const statusSymbol = response.status < 400 ? '✓' : '✗';
|
|
288
|
+
const durationColor = duration > 1000 ? ' (SLOW)' : duration > 500 ? ' (slow)' : '';
|
|
289
|
+
this.api.logger.info?.(
|
|
290
|
+
`memory-memoryrelay: ${toolName} → ${duration}ms ${statusSymbol}${durationColor}`
|
|
291
|
+
);
|
|
292
|
+
}
|
|
270
293
|
}
|
|
271
294
|
|
|
272
295
|
// Track success
|
|
@@ -3297,9 +3320,23 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
|
|
|
3297
3320
|
if (results.length > 0) {
|
|
3298
3321
|
const memoryContext = results.map((r) => `- ${r.memory.content}`).join("\n");
|
|
3299
3322
|
|
|
3300
|
-
|
|
3301
|
-
|
|
3302
|
-
|
|
3323
|
+
// Enhanced gateway logging (v0.8.2): Show memory previews
|
|
3324
|
+
if (cfg?.debug) {
|
|
3325
|
+
const snippets = results
|
|
3326
|
+
.map((r) => {
|
|
3327
|
+
const preview = r.memory.content.substring(0, 100).replace(/\n/g, ' ');
|
|
3328
|
+
const ellipsis = r.memory.content.length > 100 ? '...' : '';
|
|
3329
|
+
return ` • [${r.score.toFixed(2)}] ${preview}${ellipsis}`;
|
|
3330
|
+
})
|
|
3331
|
+
.join('\n');
|
|
3332
|
+
api.logger.info?.(
|
|
3333
|
+
`memory-memoryrelay: injecting ${results.length} memories into context:\n${snippets}`,
|
|
3334
|
+
);
|
|
3335
|
+
} else {
|
|
3336
|
+
api.logger.info?.(
|
|
3337
|
+
`memory-memoryrelay: injecting ${results.length} memories into context`,
|
|
3338
|
+
);
|
|
3339
|
+
}
|
|
3303
3340
|
|
|
3304
3341
|
prependContext +=
|
|
3305
3342
|
`\n\n<relevant-memories>\nThe following memories from MemoryRelay may be relevant:\n${memoryContext}\n</relevant-memories>`;
|
package/package.json
CHANGED