@t0ken.ai/memoryx-openclaw-plugin 1.1.3 → 1.1.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/dist/index.d.ts.map +1 -1
- package/dist/index.js +48 -5
- package/package.json +2 -2
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAsCH,UAAU,YAAY;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;CACvB;AAUD,UAAU,OAAO;IACb,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;CACrB;AAED,UAAU,YAAY;IAClB,QAAQ,EAAE,KAAK,CAAC;QACZ,EAAE,EAAE,MAAM,CAAC;QACX,OAAO,EAAE,MAAM,CAAC;QAChB,QAAQ,EAAE,MAAM,CAAC;QACjB,KAAK,EAAE,MAAM,CAAC;KACjB,CAAC,CAAC;IACH,SAAS,EAAE,OAAO,CAAC;IACnB,cAAc,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;CACxB;AA6ED,cAAM,kBAAkB;IACpB,OAAO,CAAC,QAAQ,CAAiB;IACjC,OAAO,CAAC,UAAU,CAAa;IAC/B,OAAO,CAAC,UAAU,CAAa;IAC/B,OAAO,CAAC,QAAQ,CAAc;IAC9B,OAAO,CAAC,cAAc,CAAc;IACpC,OAAO,CAAC,SAAS,CAAsB;IACvC,OAAO,CAAC,cAAc,CAAsB;IAC5C,OAAO,CAAC,OAAO,CAAW;IAE1B,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAK;IACrC,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AKtC,SAAS,IAAI;QAChB,WAAW,EAAE,OAAO,CAAC;QACrB,SAAS,EAAE,OAAO,CAAC;QACnB,YAAY,EAAE;YAAE,YAAY,EAAE,MAAM,CAAC;YAAC,UAAU,EAAE,MAAM,CAAA;SAAE,CAAA;KAC7D;CAOJ;;;;;;kBAUiB,GAAG,iBAAiB,YAAY,GAAG,IAAI;;AANzD,wBA0EE;AAEF,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -16,6 +16,32 @@ import * as os from "os";
|
|
|
16
16
|
import * as crypto from "crypto";
|
|
17
17
|
import Database from "better-sqlite3";
|
|
18
18
|
const DEFAULT_API_BASE = "https://t0ken.ai/api";
|
|
19
|
+
let logPath = "";
|
|
20
|
+
let logStream = null;
|
|
21
|
+
function getLogPath() {
|
|
22
|
+
if (logPath)
|
|
23
|
+
return logPath;
|
|
24
|
+
logPath = path.join(os.homedir(), ".openclaw", "extensions", "memoryx-openclaw-plugin", "plugin.log");
|
|
25
|
+
const dir = path.dirname(logPath);
|
|
26
|
+
if (!fs.existsSync(dir)) {
|
|
27
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
28
|
+
}
|
|
29
|
+
return logPath;
|
|
30
|
+
}
|
|
31
|
+
function log(message) {
|
|
32
|
+
const timestamp = new Date().toISOString();
|
|
33
|
+
const line = `[${timestamp}] ${message}\n`;
|
|
34
|
+
try {
|
|
35
|
+
if (!logStream) {
|
|
36
|
+
logStream = fs.createWriteStream(getLogPath(), { flags: "a" });
|
|
37
|
+
}
|
|
38
|
+
logStream.write(line);
|
|
39
|
+
}
|
|
40
|
+
catch (e) {
|
|
41
|
+
console.error("[MemoryX] Log write failed:", e);
|
|
42
|
+
}
|
|
43
|
+
console.log(`[MemoryX] ${message}`);
|
|
44
|
+
}
|
|
19
45
|
let db = null;
|
|
20
46
|
let dbPath = "";
|
|
21
47
|
function getDbPath() {
|
|
@@ -182,16 +208,28 @@ class MemoryXPlugin {
|
|
|
182
208
|
FLUSH_CHECK_INTERVAL = 30000;
|
|
183
209
|
pluginConfig = null;
|
|
184
210
|
constructor(pluginConfig) {
|
|
211
|
+
log("Constructor started");
|
|
185
212
|
this.pluginConfig = pluginConfig || null;
|
|
186
213
|
if (pluginConfig?.apiBaseUrl) {
|
|
187
214
|
this.config.apiBaseUrl = pluginConfig.apiBaseUrl;
|
|
215
|
+
log(`API Base URL set to: ${pluginConfig.apiBaseUrl}`);
|
|
188
216
|
}
|
|
189
217
|
this.config.initialized = true;
|
|
218
|
+
log("Constructor finished, scheduling async init");
|
|
190
219
|
setImmediate(() => {
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
this.
|
|
220
|
+
log("Async init started");
|
|
221
|
+
try {
|
|
222
|
+
this.loadConfig();
|
|
223
|
+
log(`Config loaded, apiKey: ${this.config.apiKey ? 'present' : 'missing'}`);
|
|
224
|
+
this.startFlushTimer();
|
|
225
|
+
log("Flush timer started");
|
|
226
|
+
if (!this.config.apiKey) {
|
|
227
|
+
log("Starting auto-register");
|
|
228
|
+
this.autoRegister().catch(e => log(`Auto-register failed: ${e}`));
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
catch (e) {
|
|
232
|
+
log(`Async init error: ${e}`);
|
|
195
233
|
}
|
|
196
234
|
});
|
|
197
235
|
}
|
|
@@ -373,15 +411,20 @@ let plugin;
|
|
|
373
411
|
export default {
|
|
374
412
|
id: "memoryx-openclaw-plugin",
|
|
375
413
|
name: "MemoryX Real-time Plugin",
|
|
376
|
-
version: "1.1.
|
|
414
|
+
version: "1.1.4",
|
|
377
415
|
description: "Real-time memory capture and recall for OpenClaw",
|
|
378
416
|
register(api, pluginConfig) {
|
|
417
|
+
log("=== REGISTER CALLED ===");
|
|
379
418
|
api.logger.info("[MemoryX] Plugin registering...");
|
|
380
419
|
if (pluginConfig?.apiBaseUrl) {
|
|
381
420
|
api.logger.info(`[MemoryX] API Base: \`${pluginConfig.apiBaseUrl}\``);
|
|
382
421
|
}
|
|
383
422
|
api.logger.info(`[MemoryX] Database: ${getDbPath()}`);
|
|
423
|
+
log(`Database path: ${getDbPath()}`);
|
|
424
|
+
log(`Log file: ${getLogPath()}`);
|
|
425
|
+
log("Creating plugin instance");
|
|
384
426
|
plugin = new MemoryXPlugin(pluginConfig);
|
|
427
|
+
log("Plugin instance created");
|
|
385
428
|
api.on("message_received", async (event, ctx) => {
|
|
386
429
|
const { content, from, timestamp } = event;
|
|
387
430
|
if (content && plugin) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@t0ken.ai/memoryx-openclaw-plugin",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.5",
|
|
4
4
|
"description": "MemoryX real-time memory capture and recall plugin for OpenClaw",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": "MemoryX Team",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"repository": {
|
|
24
24
|
"type": "git",
|
|
25
25
|
"url": "https://github.com/t0ken-ai/MemoryX.git",
|
|
26
|
-
"directory": "plugins/memoryx-
|
|
26
|
+
"directory": "plugins/memoryx-openclaw-plugin"
|
|
27
27
|
},
|
|
28
28
|
"openclaw": {
|
|
29
29
|
"extensions": [
|