@memtensor/memos-cloud-openclaw-plugin 0.1.3 → 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 +1 -1
- package/README_ZH.md +1 -1
- package/clawdbot.plugin.json +139 -34
- package/index.js +5 -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
|
@@ -13,7 +13,7 @@ A minimal OpenClaw lifecycle plugin that **recalls** memories from MemOS Cloud b
|
|
|
13
13
|
|
|
14
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
19
|
|
package/README_ZH.md
CHANGED
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
|
@@ -7,7 +7,6 @@ import {
|
|
|
7
7
|
USER_QUERY_MARKER,
|
|
8
8
|
searchMemory,
|
|
9
9
|
} from "./lib/memos-cloud-api.js";
|
|
10
|
-
|
|
11
10
|
let lastCaptureTime = 0;
|
|
12
11
|
const conversationCounters = new Map();
|
|
13
12
|
const API_KEY_HELP_URL = "https://memos-dashboard.openmem.net/cn/apikeys/";
|
|
@@ -88,6 +87,7 @@ function buildSearchPayload(cfg, prompt, ctx) {
|
|
|
88
87
|
payload.preference_limit_number = cfg.preferenceLimitNumber;
|
|
89
88
|
payload.include_tool_memory = cfg.includeToolMemory;
|
|
90
89
|
payload.tool_memory_limit_number = cfg.toolMemoryLimitNumber;
|
|
90
|
+
payload.relativity = cfg.relativity ?? 0.7;
|
|
91
91
|
|
|
92
92
|
return payload;
|
|
93
93
|
}
|
|
@@ -213,7 +213,10 @@ export default {
|
|
|
213
213
|
try {
|
|
214
214
|
const payload = buildSearchPayload(cfg, event.prompt, ctx);
|
|
215
215
|
const result = await searchMemory(cfg, payload);
|
|
216
|
-
const promptBlock = formatPromptBlock(result, {
|
|
216
|
+
const promptBlock = formatPromptBlock(result, {
|
|
217
|
+
wrapTagBlocks: true,
|
|
218
|
+
relativity: payload.relativity
|
|
219
|
+
});
|
|
217
220
|
if (!promptBlock) return;
|
|
218
221
|
|
|
219
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.');
|