@memoryrelay/plugin-memoryrelay-ai 0.8.3 → 0.8.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * OpenClaw Memory Plugin - MemoryRelay
3
- * Version: 0.8.3 (Security & Installation Fixes)
3
+ * Version: 0.8.5 (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,11 +9,21 @@
9
9
  * API: https://api.memoryrelay.net
10
10
  * Docs: https://memoryrelay.ai
11
11
  *
12
+ * ENHANCEMENTS (v0.8.5):
13
+ * - Removed fs.writeFile from export command (stdout only now)
14
+ * - No filesystem operations - passes OpenClaw security validation
15
+ * - Export usage: openclaw memoryrelay export > memories.json
16
+ *
17
+ * ENHANCEMENTS (v0.8.4):
18
+ * - Removed file logging feature to pass OpenClaw security validation
19
+ * - All debug logs now in-memory only (circular buffer)
20
+ * - logFile config option deprecated (ignored with warning)
21
+ * - Clean npm installation without security warnings
22
+ * - Gateway methods for log access coming in v0.9.0
23
+ *
12
24
  * ENHANCEMENTS (v0.8.3):
13
- * - Security fix: logFile now restricted to relative paths only
14
- * - Rejects absolute paths and path traversal attempts
15
- * - Passes OpenClaw security validation for npm installation
16
- * - Clean installation without security warnings
25
+ * - Security fix: logFile restricted to relative paths
26
+ * - Path validation (reject absolute paths and traversal)
17
27
  *
18
28
  * ENHANCEMENTS (v0.8.2):
19
29
  * - Human-readable gateway logs with memory previews
@@ -853,31 +863,8 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
853
863
  const verboseEnabled = cfg?.verbose || false;
854
864
  const maxLogEntries = cfg?.maxLogEntries || 100;
855
865
 
856
- // Security fix (v0.8.3): logFile must be relative to workspace/plugin directory
857
- // Absolute paths and path traversal are rejected
858
- let logFile: string | undefined;
859
- if (cfg?.logFile) {
860
- const requestedPath = cfg.logFile;
861
-
862
- // Reject absolute paths
863
- if (requestedPath.startsWith('/') || requestedPath.startsWith('~') || /^[A-Za-z]:/.test(requestedPath)) {
864
- api.logger.warn(
865
- `memory-memoryrelay: logFile must be relative path (got: ${requestedPath}). Using default location.`
866
- );
867
- logFile = undefined;
868
- }
869
- // Reject path traversal
870
- else if (requestedPath.includes('..')) {
871
- api.logger.warn(
872
- `memory-memoryrelay: logFile cannot contain '..' (got: ${requestedPath}). Using default location.`
873
- );
874
- logFile = undefined;
875
- }
876
- // Accept relative path (will be resolved by DebugLogger relative to workspace)
877
- else {
878
- logFile = requestedPath;
879
- }
880
- }
866
+ // Note: logFile is deprecated in v0.8.5 (removed for OpenClaw security compliance)
867
+ // All debug logs are in-memory only. Use gateway methods to access logs.
881
868
 
882
869
  let debugLogger: DebugLogger | undefined;
883
870
  let statusReporter: StatusReporter | undefined;
@@ -887,12 +874,10 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
887
874
  enabled: true,
888
875
  verbose: verboseEnabled,
889
876
  maxEntries: maxLogEntries,
890
- logFile: logFile,
891
877
  });
892
878
 
893
- const logLocation = logFile ? ` → ${logFile}` : '';
894
879
  api.logger.info(
895
- `memory-memoryrelay: debug mode enabled (verbose: ${verboseEnabled}, maxEntries: ${maxLogEntries}${logLocation})`
880
+ `memory-memoryrelay: debug mode enabled (verbose: ${verboseEnabled}, maxEntries: ${maxLogEntries}, in-memory only)`
896
881
  );
897
882
  }
898
883
 
@@ -3229,15 +3214,12 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
3229
3214
 
3230
3215
  mem
3231
3216
  .command("export")
3232
- .description("Export all memories to JSON file")
3233
- .option("--output <path>", "Output file path", "memories-export.json")
3234
- .action(async (opts) => {
3217
+ .description("Export all memories to JSON (outputs to stdout)")
3218
+ .action(async () => {
3235
3219
  try {
3236
- console.log("Exporting memories...");
3237
3220
  const memories = await client.export();
3238
- const fs = await import("fs/promises");
3239
- await fs.writeFile(opts.output, JSON.stringify(memories, null, 2));
3240
- console.log(`Exported ${memories.length} memories to ${opts.output}`);
3221
+ console.log(JSON.stringify(memories, null, 2));
3222
+ console.error(`\n# Exported ${memories.length} memories. Redirect stdout to save: memoryrelay export > memories.json`);
3241
3223
  } catch (err) {
3242
3224
  console.error(`Export failed: ${String(err)}`);
3243
3225
  }
@@ -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.8.3",
6
+ "version": "0.8.5",
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": "Relative file path for persistent debug logs (e.g., 'memoryrelay-debug.log'). Absolute paths and path traversal (..) are rejected for security."
116
+ "description": "DEPRECATED (v0.8.5): 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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@memoryrelay/plugin-memoryrelay-ai",
3
- "version": "0.8.3",
3
+ "version": "0.8.5",
4
4
  "description": "OpenClaw memory plugin for MemoryRelay API - sessions, decisions, patterns, projects & semantic search",
5
5
  "type": "module",
6
6
  "main": "index.ts",
@@ -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
- // Only load fs if logFile is specified
39
+ // logFile is no longer supported (v0.8.4)
38
40
  if (config.logFile) {
39
- try {
40
- this.fs = require("fs");
41
- } catch (err) {
42
- console.warn("fs module not available, file logging disabled");
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
  */