@memoryrelay/plugin-memoryrelay-ai 0.8.2 → 0.8.4
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 -5
- package/openclaw.plugin.json +2 -2
- package/package.json +1 -1
- package/src/debug-logger.ts +9 -27
package/index.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* OpenClaw Memory Plugin - MemoryRelay
|
|
3
|
-
* Version: 0.8.
|
|
3
|
+
* Version: 0.8.4 (OpenClaw Security Compliance)
|
|
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,17 @@
|
|
|
9
9
|
* API: https://api.memoryrelay.net
|
|
10
10
|
* Docs: https://memoryrelay.ai
|
|
11
11
|
*
|
|
12
|
+
* ENHANCEMENTS (v0.8.4):
|
|
13
|
+
* - Removed file logging feature to pass OpenClaw security validation
|
|
14
|
+
* - All debug logs now in-memory only (circular buffer)
|
|
15
|
+
* - logFile config option deprecated (ignored with warning)
|
|
16
|
+
* - Clean npm installation without security warnings
|
|
17
|
+
* - Gateway methods for log access coming in v0.9.0
|
|
18
|
+
*
|
|
19
|
+
* ENHANCEMENTS (v0.8.3):
|
|
20
|
+
* - Security fix: logFile restricted to relative paths
|
|
21
|
+
* - Path validation (reject absolute paths and traversal)
|
|
22
|
+
*
|
|
12
23
|
* ENHANCEMENTS (v0.8.2):
|
|
13
24
|
* - Human-readable gateway logs with memory previews
|
|
14
25
|
* - Show similarity scores and memory snippets during auto-recall
|
|
@@ -154,6 +165,8 @@ async function fetchWithTimeout(
|
|
|
154
165
|
class MemoryRelayClient {
|
|
155
166
|
private debugLogger?: DebugLogger;
|
|
156
167
|
private statusReporter?: StatusReporter;
|
|
168
|
+
private config?: MemoryRelayConfig;
|
|
169
|
+
private api?: OpenClawPluginApi;
|
|
157
170
|
|
|
158
171
|
constructor(
|
|
159
172
|
private readonly apiKey: string,
|
|
@@ -161,9 +174,12 @@ class MemoryRelayClient {
|
|
|
161
174
|
private readonly apiUrl: string = DEFAULT_API_URL,
|
|
162
175
|
debugLogger?: DebugLogger,
|
|
163
176
|
statusReporter?: StatusReporter,
|
|
177
|
+
api?: OpenClawPluginApi,
|
|
164
178
|
) {
|
|
165
179
|
this.debugLogger = debugLogger;
|
|
166
180
|
this.statusReporter = statusReporter;
|
|
181
|
+
this.api = api;
|
|
182
|
+
this.config = api?.pluginConfig as MemoryRelayConfig | undefined;
|
|
167
183
|
}
|
|
168
184
|
|
|
169
185
|
/**
|
|
@@ -840,9 +856,11 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
|
|
|
840
856
|
|
|
841
857
|
const debugEnabled = cfg?.debug || false;
|
|
842
858
|
const verboseEnabled = cfg?.verbose || false;
|
|
843
|
-
const logFile = cfg?.logFile;
|
|
844
859
|
const maxLogEntries = cfg?.maxLogEntries || 100;
|
|
845
860
|
|
|
861
|
+
// Note: logFile is deprecated in v0.8.4 (removed for OpenClaw security compliance)
|
|
862
|
+
// All debug logs are in-memory only. Use gateway methods to access logs.
|
|
863
|
+
|
|
846
864
|
let debugLogger: DebugLogger | undefined;
|
|
847
865
|
let statusReporter: StatusReporter | undefined;
|
|
848
866
|
|
|
@@ -851,14 +869,16 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
|
|
|
851
869
|
enabled: true,
|
|
852
870
|
verbose: verboseEnabled,
|
|
853
871
|
maxEntries: maxLogEntries,
|
|
854
|
-
logFile: logFile,
|
|
855
872
|
});
|
|
856
|
-
|
|
873
|
+
|
|
874
|
+
api.logger.info(
|
|
875
|
+
`memory-memoryrelay: debug mode enabled (verbose: ${verboseEnabled}, maxEntries: ${maxLogEntries}, in-memory only)`
|
|
876
|
+
);
|
|
857
877
|
}
|
|
858
878
|
|
|
859
879
|
statusReporter = new StatusReporter(debugLogger);
|
|
860
880
|
|
|
861
|
-
const client = new MemoryRelayClient(apiKey, agentId, apiUrl, debugLogger, statusReporter);
|
|
881
|
+
const client = new MemoryRelayClient(apiKey, agentId, apiUrl, debugLogger, statusReporter, api);
|
|
862
882
|
|
|
863
883
|
// Verify connection on startup (with timeout)
|
|
864
884
|
try {
|
package/openclaw.plugin.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"kind": "memory",
|
|
4
4
|
"name": "MemoryRelay AI",
|
|
5
5
|
"description": "AI memory service with sessions, decisions, patterns & projects (api.memoryrelay.net)",
|
|
6
|
-
"version": "0.
|
|
6
|
+
"version": "0.8.4",
|
|
7
7
|
"uiHints": {
|
|
8
8
|
"apiKey": {
|
|
9
9
|
"label": "MemoryRelay API Key",
|
|
@@ -113,7 +113,7 @@
|
|
|
113
113
|
},
|
|
114
114
|
"logFile": {
|
|
115
115
|
"type": "string",
|
|
116
|
-
"description": "
|
|
116
|
+
"description": "DEPRECATED (v0.8.4): File logging removed for OpenClaw security compliance. This option is ignored. Use gateway methods to access in-memory logs (coming in v0.9.0)."
|
|
117
117
|
},
|
|
118
118
|
"maxLogEntries": {
|
|
119
119
|
"type": "number",
|
package/package.json
CHANGED
package/src/debug-logger.ts
CHANGED
|
@@ -3,6 +3,9 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Provides comprehensive logging of API calls with request/response capture
|
|
5
5
|
* for troubleshooting and performance analysis.
|
|
6
|
+
*
|
|
7
|
+
* Note: File logging has been removed in v0.8.4 to pass OpenClaw security validation.
|
|
8
|
+
* All logs are kept in-memory only. Use gateway methods (coming in v0.9.0) to access logs.
|
|
6
9
|
*/
|
|
7
10
|
|
|
8
11
|
export interface LogEntry {
|
|
@@ -23,24 +26,22 @@ export interface DebugLoggerConfig {
|
|
|
23
26
|
enabled: boolean;
|
|
24
27
|
verbose: boolean;
|
|
25
28
|
maxEntries: number;
|
|
26
|
-
logFile?: string;
|
|
29
|
+
logFile?: string; // Deprecated: File logging removed for security compliance
|
|
27
30
|
}
|
|
28
31
|
|
|
29
32
|
export class DebugLogger {
|
|
30
33
|
private logs: LogEntry[] = [];
|
|
31
34
|
private config: DebugLoggerConfig;
|
|
32
|
-
private fs?: typeof import("fs");
|
|
33
35
|
|
|
34
36
|
constructor(config: DebugLoggerConfig) {
|
|
35
37
|
this.config = config;
|
|
36
38
|
|
|
37
|
-
//
|
|
39
|
+
// logFile is no longer supported (v0.8.4)
|
|
38
40
|
if (config.logFile) {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}
|
|
41
|
+
console.warn(
|
|
42
|
+
"memoryrelay: logFile is deprecated and ignored. " +
|
|
43
|
+
"Use gateway methods to access debug logs (coming in v0.9.0)"
|
|
44
|
+
);
|
|
44
45
|
}
|
|
45
46
|
}
|
|
46
47
|
|
|
@@ -57,11 +58,6 @@ export class DebugLogger {
|
|
|
57
58
|
if (this.logs.length > this.config.maxEntries) {
|
|
58
59
|
this.logs.shift();
|
|
59
60
|
}
|
|
60
|
-
|
|
61
|
-
// Write to file if configured
|
|
62
|
-
if (this.config.logFile && this.fs) {
|
|
63
|
-
this.writeToFile(entry);
|
|
64
|
-
}
|
|
65
61
|
}
|
|
66
62
|
|
|
67
63
|
/**
|
|
@@ -123,20 +119,6 @@ export class DebugLogger {
|
|
|
123
119
|
};
|
|
124
120
|
}
|
|
125
121
|
|
|
126
|
-
/**
|
|
127
|
-
* Write log entry to file
|
|
128
|
-
*/
|
|
129
|
-
private writeToFile(entry: LogEntry): void {
|
|
130
|
-
if (!this.fs || !this.config.logFile) return;
|
|
131
|
-
|
|
132
|
-
try {
|
|
133
|
-
const logLine = JSON.stringify(entry) + "\n";
|
|
134
|
-
this.fs.appendFileSync(this.config.logFile, logLine, "utf8");
|
|
135
|
-
} catch (err) {
|
|
136
|
-
console.error(`Failed to write debug log: ${err}`);
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
|
|
140
122
|
/**
|
|
141
123
|
* Format log entry for display
|
|
142
124
|
*/
|