@memtensor/memos-cloud-openclaw-plugin 0.1.16-beta.1 → 0.1.17-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.
@@ -1,316 +1,316 @@
1
- {
2
- "id": "memos-cloud-openclaw-plugin",
3
- "name": "MemOS Cloud OpenClaw Plugin",
4
- "description": "MemOS Cloud recall + add memory via lifecycle hooks",
5
- "version": "0.1.16-beta.1",
6
- "kind": "lifecycle",
7
- "main": "./index.js",
8
- "activation": {
9
- "onCapabilities": [
10
- "hook"
11
- ]
12
- },
13
- "configSchema": {
14
- "type": "object",
15
- "properties": {
16
- "baseUrl": {
17
- "type": "string",
18
- "description": "MemOS Cloud base URL"
19
- },
20
- "apiKey": {
21
- "type": "string",
22
- "description": "MemOS API Key (Token auth; supports ~/.openclaw/.env, ~/.moltbot/.env, ~/.clawdbot/.env; falls back to process env)"
23
- },
24
- "userId": {
25
- "type": "string",
26
- "description": "MemOS user_id (default: openclaw-user)"
27
- },
28
- "conversationId": {
29
- "type": "string",
30
- "description": "Override conversation_id"
31
- },
32
- "conversationIdPrefix": {
33
- "type": "string",
34
- "description": "conversation_id prefix"
35
- },
36
- "conversationIdSuffix": {
37
- "type": "string",
38
- "description": "conversation_id suffix"
39
- },
40
- "conversationSuffixMode": {
41
- "type": "string",
42
- "enum": [
43
- "none",
44
- "counter"
45
- ]
46
- },
47
- "useDirectSessionUserId": {
48
- "type": "boolean",
49
- "description": "When enabled, direct-session keys like agent:main:<provider>:direct:<id> use the direct id as MemOS user_id instead of the default configured userId."
50
- },
51
- "resetOnNew": {
52
- "type": "boolean"
53
- },
54
- "queryPrefix": {
55
- "type": "string",
56
- "description": "Prefix added to search queries"
57
- },
58
- "maxQueryChars": {
59
- "type": "integer",
60
- "description": "Max chars for search query"
61
- },
62
- "recallEnabled": {
63
- "type": "boolean",
64
- "default": true
65
- },
66
- "recallGlobal": {
67
- "type": "boolean"
68
- },
69
- "recallFilterEnabled": {
70
- "type": "boolean"
71
- },
72
- "recallFilterBaseUrl": {
73
- "type": "string",
74
- "description": "OpenAI-compatible base URL for recall filter model"
75
- },
76
- "recallFilterApiKey": {
77
- "type": "string",
78
- "description": "API key for recall filter model endpoint"
79
- },
80
- "recallFilterModel": {
81
- "type": "string",
82
- "description": "Model name used to filter recall candidates"
83
- },
84
- "recallFilterTimeoutMs": {
85
- "type": "integer"
86
- },
87
- "recallFilterRetries": {
88
- "type": "integer"
89
- },
90
- "recallFilterCandidateLimit": {
91
- "type": "integer"
92
- },
93
- "recallFilterMaxItemChars": {
94
- "type": "integer"
95
- },
96
- "recallFilterFailOpen": {
97
- "type": "boolean"
98
- },
99
- "addEnabled": {
100
- "type": "boolean",
101
- "default": true
102
- },
103
- "captureStrategy": {
104
- "type": "string",
105
- "enum": [
106
- "last_turn",
107
- "full_session"
108
- ]
109
- },
110
- "maxMessageChars": {
111
- "type": "integer",
112
- "description": "Max chars per message when adding"
113
- },
114
- "maxItemChars": {
115
- "type": "integer",
116
- "description": "Max chars per memory item when injecting prompt",
117
- "default": 8000
118
- },
119
- "includeAssistant": {
120
- "type": "boolean"
121
- },
122
- "memoryLimitNumber": {
123
- "type": "integer",
124
- "default": 9
125
- },
126
- "preferenceLimitNumber": {
127
- "type": "integer",
128
- "default": 6
129
- },
130
- "includePreference": {
131
- "type": "boolean",
132
- "default": true
133
- },
134
- "includeToolMemory": {
135
- "type": "boolean",
136
- "default": false
137
- },
138
- "toolMemoryLimitNumber": {
139
- "type": "integer",
140
- "default": 6
141
- },
142
- "relativity": {
143
- "type": "number",
144
- "description": "Minimum relativity score required before a recalled item is injected"
145
- },
146
- "filter": {
147
- "type": "object",
148
- "description": "MemOS search filter",
149
- "additionalProperties": true
150
- },
151
- "knowledgebaseIds": {
152
- "type": "array",
153
- "items": {
154
- "type": "string"
155
- }
156
- },
157
- "tags": {
158
- "type": "array",
159
- "items": {
160
- "type": "string"
161
- }
162
- },
163
- "info": {
164
- "type": "object",
165
- "additionalProperties": true
166
- },
167
- "agentId": {
168
- "type": "string"
169
- },
170
- "multiAgentMode": {
171
- "type": "boolean"
172
- },
173
- "allowedAgents": {
174
- "type": "array",
175
- "items": {
176
- "type": "string"
177
- },
178
- "description": "When multiAgentMode is true, only these agent IDs will activate the memory plugin. Comma-separated in env var MEMOS_ALLOWED_AGENTS. Empty list means all agents are allowed."
179
- },
180
- "appId": {
181
- "type": "string"
182
- },
183
- "allowPublic": {
184
- "type": "boolean",
185
- "default": false
186
- },
187
- "allowKnowledgebaseIds": {
188
- "type": "array",
189
- "items": {
190
- "type": "string"
191
- }
192
- },
193
- "asyncMode": {
194
- "type": "boolean"
195
- },
196
- "rumEnabled": {
197
- "type": "boolean",
198
- "default": true
199
- },
200
- "timeoutMs": {
201
- "type": "integer",
202
- "default": 5000
203
- },
204
- "retries": {
205
- "type": "integer",
206
- "default": 1
207
- },
208
- "throttleMs": {
209
- "type": "integer"
210
- },
211
- "agentOverrides": {
212
- "type": "object",
213
- "description": "Per-agent config overrides. Keys are agent IDs, values override global defaults for that agent.",
214
- "additionalProperties": {
215
- "type": "object",
216
- "properties": {
217
- "knowledgebaseIds": {
218
- "type": "array",
219
- "items": {
220
- "type": "string"
221
- }
222
- },
223
- "memoryLimitNumber": {
224
- "type": "integer"
225
- },
226
- "preferenceLimitNumber": {
227
- "type": "integer"
228
- },
229
- "includePreference": {
230
- "type": "boolean"
231
- },
232
- "includeToolMemory": {
233
- "type": "boolean"
234
- },
235
- "toolMemoryLimitNumber": {
236
- "type": "integer"
237
- },
238
- "includeSkill": {
239
- "type": "boolean"
240
- },
241
- "skillLimitNumber": {
242
- "type": "integer"
243
- },
244
- "relativity": {
245
- "type": "number"
246
- },
247
- "filter": {
248
- "type": "object",
249
- "additionalProperties": true
250
- },
251
- "recallEnabled": {
252
- "type": "boolean"
253
- },
254
- "addEnabled": {
255
- "type": "boolean"
256
- },
257
- "captureStrategy": {
258
- "type": "string",
259
- "enum": [
260
- "last_turn",
261
- "full_session"
262
- ]
263
- },
264
- "queryPrefix": {
265
- "type": "string"
266
- },
267
- "maxQueryChars": {
268
- "type": "integer"
269
- },
270
- "maxItemChars": {
271
- "type": "integer"
272
- },
273
- "maxMessageChars": {
274
- "type": "integer"
275
- },
276
- "includeAssistant": {
277
- "type": "boolean"
278
- },
279
- "recallGlobal": {
280
- "type": "boolean"
281
- },
282
- "recallFilterEnabled": {
283
- "type": "boolean"
284
- },
285
- "recallFilterModel": {
286
- "type": "string"
287
- },
288
- "recallFilterBaseUrl": {
289
- "type": "string"
290
- },
291
- "recallFilterApiKey": {
292
- "type": "string"
293
- },
294
- "allowKnowledgebaseIds": {
295
- "type": "array",
296
- "items": {
297
- "type": "string"
298
- }
299
- },
300
- "tags": {
301
- "type": "array",
302
- "items": {
303
- "type": "string"
304
- }
305
- },
306
- "throttleMs": {
307
- "type": "integer"
308
- }
309
- },
310
- "additionalProperties": false
311
- }
312
- }
313
- },
314
- "additionalProperties": false
315
- }
316
- }
1
+ {
2
+ "id": "memos-cloud-openclaw-plugin",
3
+ "name": "MemOS Cloud OpenClaw Plugin",
4
+ "description": "MemOS Cloud recall + add memory via lifecycle hooks",
5
+ "version": "0.1.17-beta.0",
6
+ "kind": "lifecycle",
7
+ "main": "./index.js",
8
+ "activation": {
9
+ "onCapabilities": [
10
+ "hook"
11
+ ]
12
+ },
13
+ "configSchema": {
14
+ "type": "object",
15
+ "properties": {
16
+ "baseUrl": {
17
+ "type": "string",
18
+ "description": "MemOS Cloud base URL"
19
+ },
20
+ "apiKey": {
21
+ "type": "string",
22
+ "description": "MemOS API Key (Token auth; supports ~/.openclaw/.env, ~/.moltbot/.env, ~/.clawdbot/.env; falls back to process env)"
23
+ },
24
+ "userId": {
25
+ "type": "string",
26
+ "description": "MemOS user_id (default: openclaw-user)"
27
+ },
28
+ "conversationId": {
29
+ "type": "string",
30
+ "description": "Override conversation_id"
31
+ },
32
+ "conversationIdPrefix": {
33
+ "type": "string",
34
+ "description": "conversation_id prefix"
35
+ },
36
+ "conversationIdSuffix": {
37
+ "type": "string",
38
+ "description": "conversation_id suffix"
39
+ },
40
+ "conversationSuffixMode": {
41
+ "type": "string",
42
+ "enum": [
43
+ "none",
44
+ "counter"
45
+ ]
46
+ },
47
+ "useDirectSessionUserId": {
48
+ "type": "boolean",
49
+ "description": "When enabled, direct-session keys like agent:main:<provider>:direct:<id> use the direct id as MemOS user_id instead of the default configured userId."
50
+ },
51
+ "resetOnNew": {
52
+ "type": "boolean"
53
+ },
54
+ "queryPrefix": {
55
+ "type": "string",
56
+ "description": "Prefix added to search queries"
57
+ },
58
+ "maxQueryChars": {
59
+ "type": "integer",
60
+ "description": "Max chars for search query"
61
+ },
62
+ "recallEnabled": {
63
+ "type": "boolean",
64
+ "default": true
65
+ },
66
+ "recallGlobal": {
67
+ "type": "boolean"
68
+ },
69
+ "recallFilterEnabled": {
70
+ "type": "boolean"
71
+ },
72
+ "recallFilterBaseUrl": {
73
+ "type": "string",
74
+ "description": "OpenAI-compatible base URL for recall filter model"
75
+ },
76
+ "recallFilterApiKey": {
77
+ "type": "string",
78
+ "description": "API key for recall filter model endpoint"
79
+ },
80
+ "recallFilterModel": {
81
+ "type": "string",
82
+ "description": "Model name used to filter recall candidates"
83
+ },
84
+ "recallFilterTimeoutMs": {
85
+ "type": "integer"
86
+ },
87
+ "recallFilterRetries": {
88
+ "type": "integer"
89
+ },
90
+ "recallFilterCandidateLimit": {
91
+ "type": "integer"
92
+ },
93
+ "recallFilterMaxItemChars": {
94
+ "type": "integer"
95
+ },
96
+ "recallFilterFailOpen": {
97
+ "type": "boolean"
98
+ },
99
+ "addEnabled": {
100
+ "type": "boolean",
101
+ "default": true
102
+ },
103
+ "captureStrategy": {
104
+ "type": "string",
105
+ "enum": [
106
+ "last_turn",
107
+ "full_session"
108
+ ]
109
+ },
110
+ "maxMessageChars": {
111
+ "type": "integer",
112
+ "description": "Max chars per message when adding"
113
+ },
114
+ "maxItemChars": {
115
+ "type": "integer",
116
+ "description": "Max chars per memory item when injecting prompt",
117
+ "default": 8000
118
+ },
119
+ "includeAssistant": {
120
+ "type": "boolean"
121
+ },
122
+ "memoryLimitNumber": {
123
+ "type": "integer",
124
+ "default": 9
125
+ },
126
+ "preferenceLimitNumber": {
127
+ "type": "integer",
128
+ "default": 6
129
+ },
130
+ "includePreference": {
131
+ "type": "boolean",
132
+ "default": true
133
+ },
134
+ "includeToolMemory": {
135
+ "type": "boolean",
136
+ "default": false
137
+ },
138
+ "toolMemoryLimitNumber": {
139
+ "type": "integer",
140
+ "default": 6
141
+ },
142
+ "relativity": {
143
+ "type": "number",
144
+ "description": "Minimum relativity score required before a recalled item is injected"
145
+ },
146
+ "filter": {
147
+ "type": "object",
148
+ "description": "MemOS search filter",
149
+ "additionalProperties": true
150
+ },
151
+ "knowledgebaseIds": {
152
+ "type": "array",
153
+ "items": {
154
+ "type": "string"
155
+ }
156
+ },
157
+ "tags": {
158
+ "type": "array",
159
+ "items": {
160
+ "type": "string"
161
+ }
162
+ },
163
+ "info": {
164
+ "type": "object",
165
+ "additionalProperties": true
166
+ },
167
+ "agentId": {
168
+ "type": "string"
169
+ },
170
+ "multiAgentMode": {
171
+ "type": "boolean"
172
+ },
173
+ "allowedAgents": {
174
+ "type": "array",
175
+ "items": {
176
+ "type": "string"
177
+ },
178
+ "description": "When multiAgentMode is true, only these agent IDs will activate the memory plugin. Comma-separated in env var MEMOS_ALLOWED_AGENTS. Empty list means all agents are allowed."
179
+ },
180
+ "appId": {
181
+ "type": "string"
182
+ },
183
+ "allowPublic": {
184
+ "type": "boolean",
185
+ "default": false
186
+ },
187
+ "allowKnowledgebaseIds": {
188
+ "type": "array",
189
+ "items": {
190
+ "type": "string"
191
+ }
192
+ },
193
+ "asyncMode": {
194
+ "type": "boolean"
195
+ },
196
+ "rumEnabled": {
197
+ "type": "boolean",
198
+ "default": true
199
+ },
200
+ "timeoutMs": {
201
+ "type": "integer",
202
+ "default": 5000
203
+ },
204
+ "retries": {
205
+ "type": "integer",
206
+ "default": 1
207
+ },
208
+ "throttleMs": {
209
+ "type": "integer"
210
+ },
211
+ "agentOverrides": {
212
+ "type": "object",
213
+ "description": "Per-agent config overrides. Keys are agent IDs, values override global defaults for that agent.",
214
+ "additionalProperties": {
215
+ "type": "object",
216
+ "properties": {
217
+ "knowledgebaseIds": {
218
+ "type": "array",
219
+ "items": {
220
+ "type": "string"
221
+ }
222
+ },
223
+ "memoryLimitNumber": {
224
+ "type": "integer"
225
+ },
226
+ "preferenceLimitNumber": {
227
+ "type": "integer"
228
+ },
229
+ "includePreference": {
230
+ "type": "boolean"
231
+ },
232
+ "includeToolMemory": {
233
+ "type": "boolean"
234
+ },
235
+ "toolMemoryLimitNumber": {
236
+ "type": "integer"
237
+ },
238
+ "includeSkill": {
239
+ "type": "boolean"
240
+ },
241
+ "skillLimitNumber": {
242
+ "type": "integer"
243
+ },
244
+ "relativity": {
245
+ "type": "number"
246
+ },
247
+ "filter": {
248
+ "type": "object",
249
+ "additionalProperties": true
250
+ },
251
+ "recallEnabled": {
252
+ "type": "boolean"
253
+ },
254
+ "addEnabled": {
255
+ "type": "boolean"
256
+ },
257
+ "captureStrategy": {
258
+ "type": "string",
259
+ "enum": [
260
+ "last_turn",
261
+ "full_session"
262
+ ]
263
+ },
264
+ "queryPrefix": {
265
+ "type": "string"
266
+ },
267
+ "maxQueryChars": {
268
+ "type": "integer"
269
+ },
270
+ "maxItemChars": {
271
+ "type": "integer"
272
+ },
273
+ "maxMessageChars": {
274
+ "type": "integer"
275
+ },
276
+ "includeAssistant": {
277
+ "type": "boolean"
278
+ },
279
+ "recallGlobal": {
280
+ "type": "boolean"
281
+ },
282
+ "recallFilterEnabled": {
283
+ "type": "boolean"
284
+ },
285
+ "recallFilterModel": {
286
+ "type": "string"
287
+ },
288
+ "recallFilterBaseUrl": {
289
+ "type": "string"
290
+ },
291
+ "recallFilterApiKey": {
292
+ "type": "string"
293
+ },
294
+ "allowKnowledgebaseIds": {
295
+ "type": "array",
296
+ "items": {
297
+ "type": "string"
298
+ }
299
+ },
300
+ "tags": {
301
+ "type": "array",
302
+ "items": {
303
+ "type": "string"
304
+ }
305
+ },
306
+ "throttleMs": {
307
+ "type": "integer"
308
+ }
309
+ },
310
+ "additionalProperties": false
311
+ }
312
+ }
313
+ },
314
+ "additionalProperties": false
315
+ }
316
+ }
package/index.js CHANGED
@@ -25,7 +25,13 @@ let lastCaptureTime = 0;
25
25
  const conversationCounters = new Map();
26
26
  const API_KEY_HELP_URL = "https://memos-dashboard.openmem.net/cn/apikeys/";
27
27
  const ENV_FILE_SEARCH_HINTS = ["~/.openclaw/.env", "~/.moltbot/.env", "~/.clawdbot/.env"];
28
- const MEMOS_SOURCE = "openclaw";
28
+ const MEMOS_SOURCE = (() => {
29
+ const platform = process.platform;
30
+ if (platform === "win32") return "openclaw_win";
31
+ if (platform === "darwin") return "openclaw_mac";
32
+ if (platform === "linux") return "openclaw_linux";
33
+ return "openclaw";
34
+ })();
29
35
 
30
36
  // Heartbeat prompts are always injected at the very beginning of the user
31
37
  // content by the host (OpenClaw). Anchoring at start prevents false positives
@@ -185,7 +191,7 @@ export function buildAddMessagePayload(cfg, messages, ctx) {
185
191
  if (cfg.tags?.length) payload.tags = cfg.tags;
186
192
 
187
193
  const info = {
188
- source: "openclaw",
194
+ source: MEMOS_SOURCE,
189
195
  sessionKey: ctx?.sessionKey,
190
196
  agentId: ctx?.agentId,
191
197
  ...(cfg.info || {}),