@memtensor/memos-cloud-openclaw-plugin 0.1.2 → 0.1.4-beta.0
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/README.md +17 -6
- package/README_ZH.md +17 -6
- package/clawdbot.plugin.json +139 -34
- package/index.js +6 -2
- package/lib/memos-cloud-api.js +10 -0
- package/moltbot.plugin.json +139 -34
- package/openclaw.plugin.json +139 -34
- package/package.json +18 -4
- package/scripts/sync-version.js +45 -0
package/README.md
CHANGED
|
@@ -11,11 +11,15 @@ A minimal OpenClaw lifecycle plugin that **recalls** memories from MemOS Cloud b
|
|
|
11
11
|
|
|
12
12
|
## Install
|
|
13
13
|
|
|
14
|
-
### Option A —
|
|
14
|
+
### Option A — NPM (Recommended)
|
|
15
15
|
```bash
|
|
16
|
-
openclaw plugins install @memtensor/memos-cloud-openclaw-plugin
|
|
16
|
+
openclaw plugins install @memtensor/memos-cloud-openclaw-plugin@latest
|
|
17
17
|
openclaw gateway restart
|
|
18
18
|
```
|
|
19
|
+
|
|
20
|
+
> **Note for Windows Users**:
|
|
21
|
+
> If you encounter `Error: spawn EINVAL`, this is a known issue with OpenClaw's plugin installer on Windows. Please use **Option B** (Manual Install) below.
|
|
22
|
+
|
|
19
23
|
Make sure it’s enabled in `~/.openclaw/openclaw.json`:
|
|
20
24
|
```json
|
|
21
25
|
{
|
|
@@ -27,20 +31,27 @@ Make sure it’s enabled in `~/.openclaw/openclaw.json`:
|
|
|
27
31
|
}
|
|
28
32
|
```
|
|
29
33
|
|
|
30
|
-
### Option B —
|
|
31
|
-
|
|
34
|
+
### Option B — Manual Install (Workaround for Windows)
|
|
35
|
+
1. Download the latest `.tgz` from [NPM](https://www.npmjs.com/package/@memtensor/memos-cloud-openclaw-plugin).
|
|
36
|
+
2. Extract it to a local folder (e.g., `C:\Users\YourName\.openclaw\extensions\memos-cloud-openclaw-plugin`).
|
|
37
|
+
3. Configure `~/.openclaw/openclaw.json` (or `%USERPROFILE%\.openclaw\openclaw.json`):
|
|
32
38
|
|
|
33
|
-
Example `~/.openclaw/openclaw.json`:
|
|
34
39
|
```json
|
|
35
40
|
{
|
|
36
41
|
"plugins": {
|
|
37
42
|
"entries": {
|
|
38
43
|
"memos-cloud-openclaw-plugin": { "enabled": true }
|
|
39
44
|
},
|
|
40
|
-
"load": {
|
|
45
|
+
"load": {
|
|
46
|
+
"paths": [
|
|
47
|
+
"C:\\Users\\YourName\\.openclaw\\extensions\\memos-cloud-openclaw-plugin\\package"
|
|
48
|
+
]
|
|
49
|
+
}
|
|
41
50
|
}
|
|
42
51
|
}
|
|
43
52
|
```
|
|
53
|
+
*Note: The extracted folder usually contains a `package` subfolder. Point to the folder containing `package.json`.*
|
|
54
|
+
|
|
44
55
|
Restart the gateway after config changes.
|
|
45
56
|
|
|
46
57
|
## Environment Variables
|
package/README_ZH.md
CHANGED
|
@@ -13,11 +13,15 @@
|
|
|
13
13
|
|
|
14
14
|
## 安装
|
|
15
15
|
|
|
16
|
-
### 方式 A —
|
|
16
|
+
### 方式 A — NPM(推荐)
|
|
17
17
|
```bash
|
|
18
|
-
openclaw plugins install @memtensor/memos-cloud-openclaw-plugin
|
|
18
|
+
openclaw plugins install @memtensor/memos-cloud-openclaw-plugin@latest
|
|
19
19
|
openclaw gateway restart
|
|
20
20
|
```
|
|
21
|
+
|
|
22
|
+
> **Windows 用户注意**:
|
|
23
|
+
> 如果遇到 `Error: spawn EINVAL` 报错,这是 OpenClaw Windows 安装器的已知问题。请使用下方的 **方式 B**(手动安装)。
|
|
24
|
+
|
|
21
25
|
确认 `~/.openclaw/openclaw.json` 中已启用:
|
|
22
26
|
```json
|
|
23
27
|
{
|
|
@@ -29,20 +33,27 @@ openclaw gateway restart
|
|
|
29
33
|
}
|
|
30
34
|
```
|
|
31
35
|
|
|
32
|
-
### 方式 B —
|
|
33
|
-
|
|
36
|
+
### 方式 B — 手动安装(Windows 解决方案)
|
|
37
|
+
1. 从 [NPM](https://www.npmjs.com/package/@memtensor/memos-cloud-openclaw-plugin) 下载最新的 `.tgz` 包。
|
|
38
|
+
2. 解压到本地目录(例如 `C:\Users\YourName\.openclaw\extensions\memos-cloud-openclaw-plugin`)。
|
|
39
|
+
3. 修改配置 `~/.openclaw/openclaw.json`(或 `%USERPROFILE%\.openclaw\openclaw.json`):
|
|
34
40
|
|
|
35
|
-
示例 `~/.openclaw/openclaw.json`:
|
|
36
41
|
```json
|
|
37
42
|
{
|
|
38
43
|
"plugins": {
|
|
39
44
|
"entries": {
|
|
40
45
|
"memos-cloud-openclaw-plugin": { "enabled": true }
|
|
41
46
|
},
|
|
42
|
-
"load": {
|
|
47
|
+
"load": {
|
|
48
|
+
"paths": [
|
|
49
|
+
"C:\\Users\\YourName\\.openclaw\\extensions\\memos-cloud-openclaw-plugin\\package"
|
|
50
|
+
]
|
|
51
|
+
}
|
|
43
52
|
}
|
|
44
53
|
}
|
|
45
54
|
```
|
|
55
|
+
*注意:解压后的文件夹通常包含一个 `package` 子文件夹,请指向包含 `package.json` 的那层目录。*
|
|
56
|
+
|
|
46
57
|
修改配置后需要重启 gateway。
|
|
47
58
|
|
|
48
59
|
## 环境变量
|
package/clawdbot.plugin.json
CHANGED
|
@@ -2,53 +2,158 @@
|
|
|
2
2
|
"id": "memos-cloud-openclaw-plugin",
|
|
3
3
|
"name": "MemOS Cloud OpenClaw Plugin",
|
|
4
4
|
"description": "MemOS Cloud recall + add memory via lifecycle hooks",
|
|
5
|
-
"version": "0.1.
|
|
5
|
+
"version": "0.1.4-beta.0",
|
|
6
6
|
"kind": "lifecycle",
|
|
7
7
|
"main": "./index.js",
|
|
8
8
|
"configSchema": {
|
|
9
9
|
"type": "object",
|
|
10
10
|
"properties": {
|
|
11
|
-
"baseUrl": {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
"
|
|
16
|
-
|
|
11
|
+
"baseUrl": {
|
|
12
|
+
"type": "string",
|
|
13
|
+
"description": "MemOS Cloud base URL"
|
|
14
|
+
},
|
|
15
|
+
"apiKey": {
|
|
16
|
+
"type": "string",
|
|
17
|
+
"description": "MemOS API Key (Token auth; supports ~/.openclaw/.env, ~/.moltbot/.env, ~/.clawdbot/.env; falls back to process env)"
|
|
18
|
+
},
|
|
19
|
+
"userId": {
|
|
20
|
+
"type": "string",
|
|
21
|
+
"description": "MemOS user_id (default: openclaw-user)",
|
|
22
|
+
"default": "openclaw-user"
|
|
23
|
+
},
|
|
24
|
+
"conversationId": {
|
|
25
|
+
"type": "string",
|
|
26
|
+
"description": "Override conversation_id"
|
|
27
|
+
},
|
|
28
|
+
"conversationIdPrefix": {
|
|
29
|
+
"type": "string",
|
|
30
|
+
"description": "conversation_id prefix"
|
|
31
|
+
},
|
|
32
|
+
"conversationIdSuffix": {
|
|
33
|
+
"type": "string",
|
|
34
|
+
"description": "conversation_id suffix"
|
|
35
|
+
},
|
|
17
36
|
"conversationSuffixMode": {
|
|
18
37
|
"type": "string",
|
|
19
|
-
"enum": [
|
|
38
|
+
"enum": [
|
|
39
|
+
"none",
|
|
40
|
+
"counter"
|
|
41
|
+
],
|
|
20
42
|
"default": "none"
|
|
21
43
|
},
|
|
22
|
-
"resetOnNew": {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
"
|
|
27
|
-
|
|
44
|
+
"resetOnNew": {
|
|
45
|
+
"type": "boolean",
|
|
46
|
+
"default": true
|
|
47
|
+
},
|
|
48
|
+
"queryPrefix": {
|
|
49
|
+
"type": "string",
|
|
50
|
+
"description": "Prefix added to search queries"
|
|
51
|
+
},
|
|
52
|
+
"maxQueryChars": {
|
|
53
|
+
"type": "integer",
|
|
54
|
+
"description": "Max chars for search query"
|
|
55
|
+
},
|
|
56
|
+
"recallEnabled": {
|
|
57
|
+
"type": "boolean",
|
|
58
|
+
"default": true
|
|
59
|
+
},
|
|
60
|
+
"recallGlobal": {
|
|
61
|
+
"type": "boolean",
|
|
62
|
+
"default": true
|
|
63
|
+
},
|
|
64
|
+
"addEnabled": {
|
|
65
|
+
"type": "boolean",
|
|
66
|
+
"default": true
|
|
67
|
+
},
|
|
28
68
|
"captureStrategy": {
|
|
29
69
|
"type": "string",
|
|
30
|
-
"enum": [
|
|
70
|
+
"enum": [
|
|
71
|
+
"last_turn",
|
|
72
|
+
"full_session"
|
|
73
|
+
],
|
|
31
74
|
"default": "last_turn"
|
|
32
75
|
},
|
|
33
|
-
"maxMessageChars": {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
"
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
"
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
"
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
"
|
|
51
|
-
|
|
76
|
+
"maxMessageChars": {
|
|
77
|
+
"type": "integer",
|
|
78
|
+
"description": "Max chars per message when adding",
|
|
79
|
+
"default": 20000
|
|
80
|
+
},
|
|
81
|
+
"includeAssistant": {
|
|
82
|
+
"type": "boolean",
|
|
83
|
+
"default": true
|
|
84
|
+
},
|
|
85
|
+
"memoryLimitNumber": {
|
|
86
|
+
"type": "integer",
|
|
87
|
+
"default": 6
|
|
88
|
+
},
|
|
89
|
+
"preferenceLimitNumber": {
|
|
90
|
+
"type": "integer",
|
|
91
|
+
"default": 6
|
|
92
|
+
},
|
|
93
|
+
"includePreference": {
|
|
94
|
+
"type": "boolean",
|
|
95
|
+
"default": true
|
|
96
|
+
},
|
|
97
|
+
"includeToolMemory": {
|
|
98
|
+
"type": "boolean",
|
|
99
|
+
"default": false
|
|
100
|
+
},
|
|
101
|
+
"toolMemoryLimitNumber": {
|
|
102
|
+
"type": "integer",
|
|
103
|
+
"default": 6
|
|
104
|
+
},
|
|
105
|
+
"filter": {
|
|
106
|
+
"type": "object",
|
|
107
|
+
"description": "MemOS search filter"
|
|
108
|
+
},
|
|
109
|
+
"knowledgebaseIds": {
|
|
110
|
+
"type": "array",
|
|
111
|
+
"items": {
|
|
112
|
+
"type": "string"
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
"tags": {
|
|
116
|
+
"type": "array",
|
|
117
|
+
"items": {
|
|
118
|
+
"type": "string"
|
|
119
|
+
}
|
|
120
|
+
},
|
|
121
|
+
"info": {
|
|
122
|
+
"type": "object",
|
|
123
|
+
"additionalProperties": true
|
|
124
|
+
},
|
|
125
|
+
"agentId": {
|
|
126
|
+
"type": "string"
|
|
127
|
+
},
|
|
128
|
+
"appId": {
|
|
129
|
+
"type": "string"
|
|
130
|
+
},
|
|
131
|
+
"allowPublic": {
|
|
132
|
+
"type": "boolean",
|
|
133
|
+
"default": false
|
|
134
|
+
},
|
|
135
|
+
"allowKnowledgebaseIds": {
|
|
136
|
+
"type": "array",
|
|
137
|
+
"items": {
|
|
138
|
+
"type": "string"
|
|
139
|
+
}
|
|
140
|
+
},
|
|
141
|
+
"asyncMode": {
|
|
142
|
+
"type": "boolean",
|
|
143
|
+
"default": true
|
|
144
|
+
},
|
|
145
|
+
"timeoutMs": {
|
|
146
|
+
"type": "integer",
|
|
147
|
+
"default": 5000
|
|
148
|
+
},
|
|
149
|
+
"retries": {
|
|
150
|
+
"type": "integer",
|
|
151
|
+
"default": 1
|
|
152
|
+
},
|
|
153
|
+
"throttleMs": {
|
|
154
|
+
"type": "integer",
|
|
155
|
+
"default": 0
|
|
156
|
+
}
|
|
52
157
|
},
|
|
53
158
|
"additionalProperties": false
|
|
54
159
|
}
|
package/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
1
2
|
import {
|
|
2
3
|
addMessage,
|
|
3
4
|
buildConfig,
|
|
@@ -6,7 +7,6 @@ import {
|
|
|
6
7
|
USER_QUERY_MARKER,
|
|
7
8
|
searchMemory,
|
|
8
9
|
} from "./lib/memos-cloud-api.js";
|
|
9
|
-
|
|
10
10
|
let lastCaptureTime = 0;
|
|
11
11
|
const conversationCounters = new Map();
|
|
12
12
|
const API_KEY_HELP_URL = "https://memos-dashboard.openmem.net/cn/apikeys/";
|
|
@@ -87,6 +87,7 @@ function buildSearchPayload(cfg, prompt, ctx) {
|
|
|
87
87
|
payload.preference_limit_number = cfg.preferenceLimitNumber;
|
|
88
88
|
payload.include_tool_memory = cfg.includeToolMemory;
|
|
89
89
|
payload.tool_memory_limit_number = cfg.toolMemoryLimitNumber;
|
|
90
|
+
payload.relativity = cfg.relativity ?? 0.7;
|
|
90
91
|
|
|
91
92
|
return payload;
|
|
92
93
|
}
|
|
@@ -212,7 +213,10 @@ export default {
|
|
|
212
213
|
try {
|
|
213
214
|
const payload = buildSearchPayload(cfg, event.prompt, ctx);
|
|
214
215
|
const result = await searchMemory(cfg, payload);
|
|
215
|
-
const promptBlock = formatPromptBlock(result, {
|
|
216
|
+
const promptBlock = formatPromptBlock(result, {
|
|
217
|
+
wrapTagBlocks: true,
|
|
218
|
+
relativity: payload.relativity
|
|
219
|
+
});
|
|
216
220
|
if (!promptBlock) return;
|
|
217
221
|
|
|
218
222
|
return {
|
package/lib/memos-cloud-api.js
CHANGED
|
@@ -291,6 +291,11 @@ function buildPromptFromData(data, options = {}) {
|
|
|
291
291
|
const preferenceList = data?.preference_detail_list ?? [];
|
|
292
292
|
|
|
293
293
|
const memoryLines = memoryList
|
|
294
|
+
.filter((item) => {
|
|
295
|
+
const score = item?.relativity ?? 1;
|
|
296
|
+
const threshold = options.relativity ?? 0;
|
|
297
|
+
return score > threshold;
|
|
298
|
+
})
|
|
294
299
|
.map((item) => {
|
|
295
300
|
const text = item?.memory_value || item?.memory_key || "";
|
|
296
301
|
return formatMemoryLine(item, text, options);
|
|
@@ -298,6 +303,11 @@ function buildPromptFromData(data, options = {}) {
|
|
|
298
303
|
.filter(Boolean);
|
|
299
304
|
|
|
300
305
|
const preferenceLines = preferenceList
|
|
306
|
+
.filter((item) => {
|
|
307
|
+
const score = item?.relativity ?? 1;
|
|
308
|
+
const threshold = options.relativity ?? 0;
|
|
309
|
+
return score > threshold;
|
|
310
|
+
})
|
|
301
311
|
.map((item) => {
|
|
302
312
|
const text = item?.preference || "";
|
|
303
313
|
return formatPreferenceLine(item, text, options);
|
package/moltbot.plugin.json
CHANGED
|
@@ -2,53 +2,158 @@
|
|
|
2
2
|
"id": "memos-cloud-openclaw-plugin",
|
|
3
3
|
"name": "MemOS Cloud OpenClaw Plugin",
|
|
4
4
|
"description": "MemOS Cloud recall + add memory via lifecycle hooks",
|
|
5
|
-
"version": "0.1.
|
|
5
|
+
"version": "0.1.4-beta.0",
|
|
6
6
|
"kind": "lifecycle",
|
|
7
7
|
"main": "./index.js",
|
|
8
8
|
"configSchema": {
|
|
9
9
|
"type": "object",
|
|
10
10
|
"properties": {
|
|
11
|
-
"baseUrl": {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
"
|
|
16
|
-
|
|
11
|
+
"baseUrl": {
|
|
12
|
+
"type": "string",
|
|
13
|
+
"description": "MemOS Cloud base URL"
|
|
14
|
+
},
|
|
15
|
+
"apiKey": {
|
|
16
|
+
"type": "string",
|
|
17
|
+
"description": "MemOS API Key (Token auth; supports ~/.openclaw/.env, ~/.moltbot/.env, ~/.clawdbot/.env; falls back to process env)"
|
|
18
|
+
},
|
|
19
|
+
"userId": {
|
|
20
|
+
"type": "string",
|
|
21
|
+
"description": "MemOS user_id (default: openclaw-user)",
|
|
22
|
+
"default": "openclaw-user"
|
|
23
|
+
},
|
|
24
|
+
"conversationId": {
|
|
25
|
+
"type": "string",
|
|
26
|
+
"description": "Override conversation_id"
|
|
27
|
+
},
|
|
28
|
+
"conversationIdPrefix": {
|
|
29
|
+
"type": "string",
|
|
30
|
+
"description": "conversation_id prefix"
|
|
31
|
+
},
|
|
32
|
+
"conversationIdSuffix": {
|
|
33
|
+
"type": "string",
|
|
34
|
+
"description": "conversation_id suffix"
|
|
35
|
+
},
|
|
17
36
|
"conversationSuffixMode": {
|
|
18
37
|
"type": "string",
|
|
19
|
-
"enum": [
|
|
38
|
+
"enum": [
|
|
39
|
+
"none",
|
|
40
|
+
"counter"
|
|
41
|
+
],
|
|
20
42
|
"default": "none"
|
|
21
43
|
},
|
|
22
|
-
"resetOnNew": {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
"
|
|
27
|
-
|
|
44
|
+
"resetOnNew": {
|
|
45
|
+
"type": "boolean",
|
|
46
|
+
"default": true
|
|
47
|
+
},
|
|
48
|
+
"queryPrefix": {
|
|
49
|
+
"type": "string",
|
|
50
|
+
"description": "Prefix added to search queries"
|
|
51
|
+
},
|
|
52
|
+
"maxQueryChars": {
|
|
53
|
+
"type": "integer",
|
|
54
|
+
"description": "Max chars for search query"
|
|
55
|
+
},
|
|
56
|
+
"recallEnabled": {
|
|
57
|
+
"type": "boolean",
|
|
58
|
+
"default": true
|
|
59
|
+
},
|
|
60
|
+
"recallGlobal": {
|
|
61
|
+
"type": "boolean",
|
|
62
|
+
"default": true
|
|
63
|
+
},
|
|
64
|
+
"addEnabled": {
|
|
65
|
+
"type": "boolean",
|
|
66
|
+
"default": true
|
|
67
|
+
},
|
|
28
68
|
"captureStrategy": {
|
|
29
69
|
"type": "string",
|
|
30
|
-
"enum": [
|
|
70
|
+
"enum": [
|
|
71
|
+
"last_turn",
|
|
72
|
+
"full_session"
|
|
73
|
+
],
|
|
31
74
|
"default": "last_turn"
|
|
32
75
|
},
|
|
33
|
-
"maxMessageChars": {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
"
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
"
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
"
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
"
|
|
51
|
-
|
|
76
|
+
"maxMessageChars": {
|
|
77
|
+
"type": "integer",
|
|
78
|
+
"description": "Max chars per message when adding",
|
|
79
|
+
"default": 20000
|
|
80
|
+
},
|
|
81
|
+
"includeAssistant": {
|
|
82
|
+
"type": "boolean",
|
|
83
|
+
"default": true
|
|
84
|
+
},
|
|
85
|
+
"memoryLimitNumber": {
|
|
86
|
+
"type": "integer",
|
|
87
|
+
"default": 6
|
|
88
|
+
},
|
|
89
|
+
"preferenceLimitNumber": {
|
|
90
|
+
"type": "integer",
|
|
91
|
+
"default": 6
|
|
92
|
+
},
|
|
93
|
+
"includePreference": {
|
|
94
|
+
"type": "boolean",
|
|
95
|
+
"default": true
|
|
96
|
+
},
|
|
97
|
+
"includeToolMemory": {
|
|
98
|
+
"type": "boolean",
|
|
99
|
+
"default": false
|
|
100
|
+
},
|
|
101
|
+
"toolMemoryLimitNumber": {
|
|
102
|
+
"type": "integer",
|
|
103
|
+
"default": 6
|
|
104
|
+
},
|
|
105
|
+
"filter": {
|
|
106
|
+
"type": "object",
|
|
107
|
+
"description": "MemOS search filter"
|
|
108
|
+
},
|
|
109
|
+
"knowledgebaseIds": {
|
|
110
|
+
"type": "array",
|
|
111
|
+
"items": {
|
|
112
|
+
"type": "string"
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
"tags": {
|
|
116
|
+
"type": "array",
|
|
117
|
+
"items": {
|
|
118
|
+
"type": "string"
|
|
119
|
+
}
|
|
120
|
+
},
|
|
121
|
+
"info": {
|
|
122
|
+
"type": "object",
|
|
123
|
+
"additionalProperties": true
|
|
124
|
+
},
|
|
125
|
+
"agentId": {
|
|
126
|
+
"type": "string"
|
|
127
|
+
},
|
|
128
|
+
"appId": {
|
|
129
|
+
"type": "string"
|
|
130
|
+
},
|
|
131
|
+
"allowPublic": {
|
|
132
|
+
"type": "boolean",
|
|
133
|
+
"default": false
|
|
134
|
+
},
|
|
135
|
+
"allowKnowledgebaseIds": {
|
|
136
|
+
"type": "array",
|
|
137
|
+
"items": {
|
|
138
|
+
"type": "string"
|
|
139
|
+
}
|
|
140
|
+
},
|
|
141
|
+
"asyncMode": {
|
|
142
|
+
"type": "boolean",
|
|
143
|
+
"default": true
|
|
144
|
+
},
|
|
145
|
+
"timeoutMs": {
|
|
146
|
+
"type": "integer",
|
|
147
|
+
"default": 5000
|
|
148
|
+
},
|
|
149
|
+
"retries": {
|
|
150
|
+
"type": "integer",
|
|
151
|
+
"default": 1
|
|
152
|
+
},
|
|
153
|
+
"throttleMs": {
|
|
154
|
+
"type": "integer",
|
|
155
|
+
"default": 0
|
|
156
|
+
}
|
|
52
157
|
},
|
|
53
158
|
"additionalProperties": false
|
|
54
159
|
}
|
package/openclaw.plugin.json
CHANGED
|
@@ -2,53 +2,158 @@
|
|
|
2
2
|
"id": "memos-cloud-openclaw-plugin",
|
|
3
3
|
"name": "MemOS Cloud OpenClaw Plugin",
|
|
4
4
|
"description": "MemOS Cloud recall + add memory via lifecycle hooks",
|
|
5
|
-
"version": "0.1.
|
|
5
|
+
"version": "0.1.4-beta.0",
|
|
6
6
|
"kind": "lifecycle",
|
|
7
7
|
"main": "./index.js",
|
|
8
8
|
"configSchema": {
|
|
9
9
|
"type": "object",
|
|
10
10
|
"properties": {
|
|
11
|
-
"baseUrl": {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
"
|
|
16
|
-
|
|
11
|
+
"baseUrl": {
|
|
12
|
+
"type": "string",
|
|
13
|
+
"description": "MemOS Cloud base URL"
|
|
14
|
+
},
|
|
15
|
+
"apiKey": {
|
|
16
|
+
"type": "string",
|
|
17
|
+
"description": "MemOS API Key (Token auth; supports ~/.openclaw/.env, ~/.moltbot/.env, ~/.clawdbot/.env; falls back to process env)"
|
|
18
|
+
},
|
|
19
|
+
"userId": {
|
|
20
|
+
"type": "string",
|
|
21
|
+
"description": "MemOS user_id (default: openclaw-user)",
|
|
22
|
+
"default": "openclaw-user"
|
|
23
|
+
},
|
|
24
|
+
"conversationId": {
|
|
25
|
+
"type": "string",
|
|
26
|
+
"description": "Override conversation_id"
|
|
27
|
+
},
|
|
28
|
+
"conversationIdPrefix": {
|
|
29
|
+
"type": "string",
|
|
30
|
+
"description": "conversation_id prefix"
|
|
31
|
+
},
|
|
32
|
+
"conversationIdSuffix": {
|
|
33
|
+
"type": "string",
|
|
34
|
+
"description": "conversation_id suffix"
|
|
35
|
+
},
|
|
17
36
|
"conversationSuffixMode": {
|
|
18
37
|
"type": "string",
|
|
19
|
-
"enum": [
|
|
38
|
+
"enum": [
|
|
39
|
+
"none",
|
|
40
|
+
"counter"
|
|
41
|
+
],
|
|
20
42
|
"default": "none"
|
|
21
43
|
},
|
|
22
|
-
"resetOnNew": {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
"
|
|
27
|
-
|
|
44
|
+
"resetOnNew": {
|
|
45
|
+
"type": "boolean",
|
|
46
|
+
"default": true
|
|
47
|
+
},
|
|
48
|
+
"queryPrefix": {
|
|
49
|
+
"type": "string",
|
|
50
|
+
"description": "Prefix added to search queries"
|
|
51
|
+
},
|
|
52
|
+
"maxQueryChars": {
|
|
53
|
+
"type": "integer",
|
|
54
|
+
"description": "Max chars for search query"
|
|
55
|
+
},
|
|
56
|
+
"recallEnabled": {
|
|
57
|
+
"type": "boolean",
|
|
58
|
+
"default": true
|
|
59
|
+
},
|
|
60
|
+
"recallGlobal": {
|
|
61
|
+
"type": "boolean",
|
|
62
|
+
"default": true
|
|
63
|
+
},
|
|
64
|
+
"addEnabled": {
|
|
65
|
+
"type": "boolean",
|
|
66
|
+
"default": true
|
|
67
|
+
},
|
|
28
68
|
"captureStrategy": {
|
|
29
69
|
"type": "string",
|
|
30
|
-
"enum": [
|
|
70
|
+
"enum": [
|
|
71
|
+
"last_turn",
|
|
72
|
+
"full_session"
|
|
73
|
+
],
|
|
31
74
|
"default": "last_turn"
|
|
32
75
|
},
|
|
33
|
-
"maxMessageChars": {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
"
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
"
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
"
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
"
|
|
51
|
-
|
|
76
|
+
"maxMessageChars": {
|
|
77
|
+
"type": "integer",
|
|
78
|
+
"description": "Max chars per message when adding",
|
|
79
|
+
"default": 20000
|
|
80
|
+
},
|
|
81
|
+
"includeAssistant": {
|
|
82
|
+
"type": "boolean",
|
|
83
|
+
"default": true
|
|
84
|
+
},
|
|
85
|
+
"memoryLimitNumber": {
|
|
86
|
+
"type": "integer",
|
|
87
|
+
"default": 6
|
|
88
|
+
},
|
|
89
|
+
"preferenceLimitNumber": {
|
|
90
|
+
"type": "integer",
|
|
91
|
+
"default": 6
|
|
92
|
+
},
|
|
93
|
+
"includePreference": {
|
|
94
|
+
"type": "boolean",
|
|
95
|
+
"default": true
|
|
96
|
+
},
|
|
97
|
+
"includeToolMemory": {
|
|
98
|
+
"type": "boolean",
|
|
99
|
+
"default": false
|
|
100
|
+
},
|
|
101
|
+
"toolMemoryLimitNumber": {
|
|
102
|
+
"type": "integer",
|
|
103
|
+
"default": 6
|
|
104
|
+
},
|
|
105
|
+
"filter": {
|
|
106
|
+
"type": "object",
|
|
107
|
+
"description": "MemOS search filter"
|
|
108
|
+
},
|
|
109
|
+
"knowledgebaseIds": {
|
|
110
|
+
"type": "array",
|
|
111
|
+
"items": {
|
|
112
|
+
"type": "string"
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
"tags": {
|
|
116
|
+
"type": "array",
|
|
117
|
+
"items": {
|
|
118
|
+
"type": "string"
|
|
119
|
+
}
|
|
120
|
+
},
|
|
121
|
+
"info": {
|
|
122
|
+
"type": "object",
|
|
123
|
+
"additionalProperties": true
|
|
124
|
+
},
|
|
125
|
+
"agentId": {
|
|
126
|
+
"type": "string"
|
|
127
|
+
},
|
|
128
|
+
"appId": {
|
|
129
|
+
"type": "string"
|
|
130
|
+
},
|
|
131
|
+
"allowPublic": {
|
|
132
|
+
"type": "boolean",
|
|
133
|
+
"default": false
|
|
134
|
+
},
|
|
135
|
+
"allowKnowledgebaseIds": {
|
|
136
|
+
"type": "array",
|
|
137
|
+
"items": {
|
|
138
|
+
"type": "string"
|
|
139
|
+
}
|
|
140
|
+
},
|
|
141
|
+
"asyncMode": {
|
|
142
|
+
"type": "boolean",
|
|
143
|
+
"default": true
|
|
144
|
+
},
|
|
145
|
+
"timeoutMs": {
|
|
146
|
+
"type": "integer",
|
|
147
|
+
"default": 5000
|
|
148
|
+
},
|
|
149
|
+
"retries": {
|
|
150
|
+
"type": "integer",
|
|
151
|
+
"default": 1
|
|
152
|
+
},
|
|
153
|
+
"throttleMs": {
|
|
154
|
+
"type": "integer",
|
|
155
|
+
"default": 0
|
|
156
|
+
}
|
|
52
157
|
},
|
|
53
158
|
"additionalProperties": false
|
|
54
159
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@memtensor/memos-cloud-openclaw-plugin",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4-beta.0",
|
|
4
4
|
"description": "OpenClaw lifecycle plugin for MemOS Cloud (add + recall memory)",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"sync-version": "node scripts/sync-version.js",
|
|
7
|
+
"version": "npm run sync-version && git add openclaw.plugin.json moltbot.plugin.json clawdbot.plugin.json",
|
|
8
|
+
"publish-beta": "npm publish --tag beta",
|
|
9
|
+
"publish-beta-patch": "npm version prepatch --preid=beta && npm publish --tag beta",
|
|
10
|
+
"publish-latest": "npm version $(node -p \"require('./package.json').version.split('-')[0]\") && npm publish",
|
|
11
|
+
"publish-latest-patch": "npm version patch && npm publish"
|
|
12
|
+
},
|
|
5
13
|
"keywords": [
|
|
6
14
|
"memos",
|
|
7
15
|
"memos-cloud",
|
|
@@ -21,12 +29,18 @@
|
|
|
21
29
|
"author": "MemTensor",
|
|
22
30
|
"license": "MIT",
|
|
23
31
|
"openclaw": {
|
|
24
|
-
"extensions": [
|
|
32
|
+
"extensions": [
|
|
33
|
+
"./index.js"
|
|
34
|
+
]
|
|
25
35
|
},
|
|
26
36
|
"clawdbot": {
|
|
27
|
-
"extensions": [
|
|
37
|
+
"extensions": [
|
|
38
|
+
"./index.js"
|
|
39
|
+
]
|
|
28
40
|
},
|
|
29
41
|
"moltbot": {
|
|
30
|
-
"extensions": [
|
|
42
|
+
"extensions": [
|
|
43
|
+
"./index.js"
|
|
44
|
+
]
|
|
31
45
|
}
|
|
32
46
|
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import fs from 'fs';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
import { fileURLToPath } from 'url';
|
|
4
|
+
|
|
5
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = path.dirname(__filename);
|
|
7
|
+
|
|
8
|
+
// Read the updated package.json to get the new version
|
|
9
|
+
const packageJsonPath = path.resolve(__dirname, '../package.json');
|
|
10
|
+
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'));
|
|
11
|
+
const newVersion = packageJson.version;
|
|
12
|
+
|
|
13
|
+
console.log(`Syncing version to ${newVersion}...`);
|
|
14
|
+
|
|
15
|
+
const filesToUpdate = [
|
|
16
|
+
'openclaw.plugin.json',
|
|
17
|
+
'moltbot.plugin.json',
|
|
18
|
+
'clawdbot.plugin.json'
|
|
19
|
+
];
|
|
20
|
+
|
|
21
|
+
filesToUpdate.forEach(fileName => {
|
|
22
|
+
const filePath = path.resolve(__dirname, '..', fileName);
|
|
23
|
+
|
|
24
|
+
if (fs.existsSync(filePath)) {
|
|
25
|
+
try {
|
|
26
|
+
const content = JSON.parse(fs.readFileSync(filePath, 'utf8'));
|
|
27
|
+
|
|
28
|
+
if (content.version !== newVersion) {
|
|
29
|
+
content.version = newVersion;
|
|
30
|
+
// Write back with 2 spaces indentation and a newline at the end
|
|
31
|
+
fs.writeFileSync(filePath, JSON.stringify(content, null, 2) + '\n', 'utf8');
|
|
32
|
+
console.log(`Updated ${fileName} to version ${newVersion}`);
|
|
33
|
+
} else {
|
|
34
|
+
console.log(`${fileName} is already at version ${newVersion}`);
|
|
35
|
+
}
|
|
36
|
+
} catch (error) {
|
|
37
|
+
console.error(`Error updating ${fileName}:`, error.message);
|
|
38
|
+
process.exit(1);
|
|
39
|
+
}
|
|
40
|
+
} else {
|
|
41
|
+
console.warn(`Warning: ${fileName} not found, skipping.`);
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
console.log('Version sync complete.');
|