@bsbofmusic/memos-memu-local-memory-tools-for-agent 1.0.2 → 1.0.3
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/bin/mcp-server.js +1 -1
- package/package.json +1 -1
- package/src/tools/memos.js +10 -3
- package/src/tools/verify.js +26 -13
package/bin/mcp-server.js
CHANGED
|
@@ -16,7 +16,7 @@ import { memuk_search } from '../src/tools/memuk.js';
|
|
|
16
16
|
import { verify_memory_system } from '../src/tools/verify.js';
|
|
17
17
|
|
|
18
18
|
const server = new Server(
|
|
19
|
-
{ name: 'memos-memu-local-memory-tools-for-agent', version: '1.0.
|
|
19
|
+
{ name: 'memos-memu-local-memory-tools-for-agent', version: '1.0.3' },
|
|
20
20
|
{ capabilities: { tools: {} } }
|
|
21
21
|
);
|
|
22
22
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bsbofmusic/memos-memu-local-memory-tools-for-agent",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"description": "MCP server — one-shot install + query for memos (PostgreSQL) and memuK (SQLite) local memory. Designed for OpenClaw agents.",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"type": "module",
|
package/src/tools/memos.js
CHANGED
|
@@ -46,9 +46,16 @@ FROM (
|
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
const lines = rows.map((r, i) => {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
49
|
+
// created_ts is bigint (milliseconds) — parse safely
|
|
50
|
+
let ts = 'unknown';
|
|
51
|
+
try {
|
|
52
|
+
const ms = typeof r.created_ts === 'number' ? r.created_ts : parseInt(String(r.created_ts));
|
|
53
|
+
if (ms > 1e12) {
|
|
54
|
+
ts = new Date(ms).toLocaleString('zh-CN', { timeZone: 'Asia/Shanghai' });
|
|
55
|
+
} else if (ms > 1e9) {
|
|
56
|
+
ts = new Date(ms * 1000).toLocaleString('zh-CN', { timeZone: 'Asia/Shanghai' });
|
|
57
|
+
}
|
|
58
|
+
} catch {}
|
|
52
59
|
return `─── ${i + 1}. [id:${r.id}] ${ts} (${r.visibility}) ───\n${r.content}`;
|
|
53
60
|
});
|
|
54
61
|
|
package/src/tools/verify.js
CHANGED
|
@@ -78,21 +78,34 @@ export async function verify_memory_system() {
|
|
|
78
78
|
|
|
79
79
|
// 6. MCPorter config
|
|
80
80
|
check('MCPorter config', () => {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
81
|
+
// Check both possible locations
|
|
82
|
+
const cfgPaths = [
|
|
83
|
+
path.join(env.workspaceDir, 'mcporter.json'),
|
|
84
|
+
path.join(env.workspaceDir, 'config', 'mcporter.json'),
|
|
85
|
+
path.join(env.workspaceDir, 'workspace', 'config', 'mcporter.json'),
|
|
86
|
+
];
|
|
87
|
+
let foundPath = null;
|
|
88
|
+
let cfg = null;
|
|
89
|
+
for (const p of cfgPaths) {
|
|
90
|
+
if (fs.existsSync(p)) {
|
|
91
|
+
try {
|
|
92
|
+
cfg = JSON.parse(fs.readFileSync(p, 'utf8'));
|
|
93
|
+
foundPath = p;
|
|
94
|
+
break;
|
|
95
|
+
} catch {}
|
|
96
|
+
}
|
|
84
97
|
}
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
const hasEntry = cfg?.servers?.['memos-memu-local-memory-tools-for-agent'];
|
|
88
|
-
return {
|
|
89
|
-
component: 'MCPorter config',
|
|
90
|
-
status: hasEntry ? 'PASS' : 'FAIL',
|
|
91
|
-
detail: hasEntry ? 'MCP server entry found' : 'MCP server entry missing',
|
|
92
|
-
};
|
|
93
|
-
} catch (err) {
|
|
94
|
-
return { component: 'MCPorter config', status: 'FAIL', detail: `JSON parse error: ${err.message}` };
|
|
98
|
+
if (!foundPath || !cfg) {
|
|
99
|
+
return { component: 'MCPorter config', status: 'FAIL', detail: 'mcporter.json not found in expected paths' };
|
|
95
100
|
}
|
|
101
|
+
const hasEntry =
|
|
102
|
+
cfg?.servers?.['memos-memu-local-memory-tools-for-agent'] ||
|
|
103
|
+
cfg?.mcpServers?.['memos-memu-local-memory-tools-for-agent'];
|
|
104
|
+
return {
|
|
105
|
+
component: 'MCPorter config',
|
|
106
|
+
status: hasEntry ? 'PASS' : 'FAIL',
|
|
107
|
+
detail: hasEntry ? `Entry found in ${foundPath}` : `No MCP entry in ${foundPath}`,
|
|
108
|
+
};
|
|
96
109
|
});
|
|
97
110
|
|
|
98
111
|
// 7. Cron
|