@memtensor/memos-cloud-openclaw-plugin 0.1.3 → 0.1.5-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 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
 
@@ -121,6 +121,7 @@ In `plugins.entries.memos-cloud-openclaw-plugin.config`:
121
121
  "includePreference": true,
122
122
  "includeToolMemory": false,
123
123
  "toolMemoryLimitNumber": 6,
124
+ "relativity": 0.45,
124
125
  "tags": ["openclaw"],
125
126
  "asyncMode": true
126
127
  }
package/README_ZH.md CHANGED
@@ -15,7 +15,7 @@
15
15
 
16
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
21
 
@@ -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.3",
5
+ "version": "0.1.5-beta.0",
6
6
  "kind": "lifecycle",
7
7
  "main": "./index.js",
8
8
  "configSchema": {
9
9
  "type": "object",
10
10
  "properties": {
11
- "baseUrl": { "type": "string", "description": "MemOS Cloud base URL" },
12
- "apiKey": { "type": "string", "description": "MemOS API Key (Token auth; supports ~/.openclaw/.env, ~/.moltbot/.env, ~/.clawdbot/.env; falls back to process env)" },
13
- "userId": { "type": "string", "description": "MemOS user_id (default: openclaw-user)", "default": "openclaw-user" },
14
- "conversationId": { "type": "string", "description": "Override conversation_id" },
15
- "conversationIdPrefix": { "type": "string", "description": "conversation_id prefix" },
16
- "conversationIdSuffix": { "type": "string", "description": "conversation_id suffix" },
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": ["none", "counter"],
38
+ "enum": [
39
+ "none",
40
+ "counter"
41
+ ],
20
42
  "default": "none"
21
43
  },
22
- "resetOnNew": { "type": "boolean", "default": true },
23
- "queryPrefix": { "type": "string", "description": "Prefix added to search queries" },
24
- "maxQueryChars": { "type": "integer", "description": "Max chars for search query" },
25
- "recallEnabled": { "type": "boolean", "default": true },
26
- "recallGlobal": { "type": "boolean", "default": true },
27
- "addEnabled": { "type": "boolean", "default": true },
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": ["last_turn", "full_session"],
70
+ "enum": [
71
+ "last_turn",
72
+ "full_session"
73
+ ],
31
74
  "default": "last_turn"
32
75
  },
33
- "maxMessageChars": { "type": "integer", "description": "Max chars per message when adding", "default": 20000 },
34
- "includeAssistant": { "type": "boolean", "default": true },
35
- "memoryLimitNumber": { "type": "integer", "default": 6 },
36
- "preferenceLimitNumber": { "type": "integer", "default": 6 },
37
- "includePreference": { "type": "boolean", "default": true },
38
- "includeToolMemory": { "type": "boolean", "default": false },
39
- "toolMemoryLimitNumber": { "type": "integer", "default": 6 },
40
- "filter": { "type": "object", "description": "MemOS search filter" },
41
- "knowledgebaseIds": { "type": "array", "items": { "type": "string" } },
42
- "tags": { "type": "array", "items": { "type": "string" } },
43
- "info": { "type": "object", "additionalProperties": true },
44
- "agentId": { "type": "string" },
45
- "appId": { "type": "string" },
46
- "allowPublic": { "type": "boolean", "default": false },
47
- "allowKnowledgebaseIds": { "type": "array", "items": { "type": "string" } },
48
- "asyncMode": { "type": "boolean", "default": true },
49
- "timeoutMs": { "type": "integer", "default": 5000 },
50
- "retries": { "type": "integer", "default": 1 },
51
- "throttleMs": { "type": "integer", "default": 0 }
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;
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, { wrapTagBlocks: true });
216
+ const promptBlock = formatPromptBlock(result, {
217
+ wrapTagBlocks: true,
218
+ relativity: payload.relativity
219
+ });
217
220
  if (!promptBlock) return;
218
221
 
219
222
  return {
@@ -165,6 +165,7 @@ export function buildConfig(pluginConfig = {}) {
165
165
  includePreference: cfg.includePreference !== false,
166
166
  includeToolMemory: cfg.includeToolMemory === true,
167
167
  toolMemoryLimitNumber: cfg.toolMemoryLimitNumber ?? 6,
168
+ relativity: cfg.relativity ?? 0.45,
168
169
  filter: cfg.filter,
169
170
  knowledgebaseIds: cfg.knowledgebaseIds ?? [],
170
171
  tags: cfg.tags ?? ["openclaw"],
@@ -291,6 +292,11 @@ function buildPromptFromData(data, options = {}) {
291
292
  const preferenceList = data?.preference_detail_list ?? [];
292
293
 
293
294
  const memoryLines = memoryList
295
+ .filter((item) => {
296
+ const score = item?.relativity ?? 1;
297
+ const threshold = options.relativity ?? 0;
298
+ return score > threshold;
299
+ })
294
300
  .map((item) => {
295
301
  const text = item?.memory_value || item?.memory_key || "";
296
302
  return formatMemoryLine(item, text, options);
@@ -298,6 +304,11 @@ function buildPromptFromData(data, options = {}) {
298
304
  .filter(Boolean);
299
305
 
300
306
  const preferenceLines = preferenceList
307
+ .filter((item) => {
308
+ const score = item?.relativity ?? 1;
309
+ const threshold = options.relativity ?? 0;
310
+ return score > threshold;
311
+ })
301
312
  .map((item) => {
302
313
  const text = item?.preference || "";
303
314
  return formatPreferenceLine(item, text, options);
@@ -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.3",
5
+ "version": "0.1.5-beta.0",
6
6
  "kind": "lifecycle",
7
7
  "main": "./index.js",
8
8
  "configSchema": {
9
9
  "type": "object",
10
10
  "properties": {
11
- "baseUrl": { "type": "string", "description": "MemOS Cloud base URL" },
12
- "apiKey": { "type": "string", "description": "MemOS API Key (Token auth; supports ~/.openclaw/.env, ~/.moltbot/.env, ~/.clawdbot/.env; falls back to process env)" },
13
- "userId": { "type": "string", "description": "MemOS user_id (default: openclaw-user)", "default": "openclaw-user" },
14
- "conversationId": { "type": "string", "description": "Override conversation_id" },
15
- "conversationIdPrefix": { "type": "string", "description": "conversation_id prefix" },
16
- "conversationIdSuffix": { "type": "string", "description": "conversation_id suffix" },
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": ["none", "counter"],
38
+ "enum": [
39
+ "none",
40
+ "counter"
41
+ ],
20
42
  "default": "none"
21
43
  },
22
- "resetOnNew": { "type": "boolean", "default": true },
23
- "queryPrefix": { "type": "string", "description": "Prefix added to search queries" },
24
- "maxQueryChars": { "type": "integer", "description": "Max chars for search query" },
25
- "recallEnabled": { "type": "boolean", "default": true },
26
- "recallGlobal": { "type": "boolean", "default": true },
27
- "addEnabled": { "type": "boolean", "default": true },
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": ["last_turn", "full_session"],
70
+ "enum": [
71
+ "last_turn",
72
+ "full_session"
73
+ ],
31
74
  "default": "last_turn"
32
75
  },
33
- "maxMessageChars": { "type": "integer", "description": "Max chars per message when adding", "default": 20000 },
34
- "includeAssistant": { "type": "boolean", "default": true },
35
- "memoryLimitNumber": { "type": "integer", "default": 6 },
36
- "preferenceLimitNumber": { "type": "integer", "default": 6 },
37
- "includePreference": { "type": "boolean", "default": true },
38
- "includeToolMemory": { "type": "boolean", "default": false },
39
- "toolMemoryLimitNumber": { "type": "integer", "default": 6 },
40
- "filter": { "type": "object", "description": "MemOS search filter" },
41
- "knowledgebaseIds": { "type": "array", "items": { "type": "string" } },
42
- "tags": { "type": "array", "items": { "type": "string" } },
43
- "info": { "type": "object", "additionalProperties": true },
44
- "agentId": { "type": "string" },
45
- "appId": { "type": "string" },
46
- "allowPublic": { "type": "boolean", "default": false },
47
- "allowKnowledgebaseIds": { "type": "array", "items": { "type": "string" } },
48
- "asyncMode": { "type": "boolean", "default": true },
49
- "timeoutMs": { "type": "integer", "default": 5000 },
50
- "retries": { "type": "integer", "default": 1 },
51
- "throttleMs": { "type": "integer", "default": 0 }
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
  }
@@ -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.3",
5
+ "version": "0.1.5-beta.0",
6
6
  "kind": "lifecycle",
7
7
  "main": "./index.js",
8
8
  "configSchema": {
9
9
  "type": "object",
10
10
  "properties": {
11
- "baseUrl": { "type": "string", "description": "MemOS Cloud base URL" },
12
- "apiKey": { "type": "string", "description": "MemOS API Key (Token auth; supports ~/.openclaw/.env, ~/.moltbot/.env, ~/.clawdbot/.env; falls back to process env)" },
13
- "userId": { "type": "string", "description": "MemOS user_id (default: openclaw-user)", "default": "openclaw-user" },
14
- "conversationId": { "type": "string", "description": "Override conversation_id" },
15
- "conversationIdPrefix": { "type": "string", "description": "conversation_id prefix" },
16
- "conversationIdSuffix": { "type": "string", "description": "conversation_id suffix" },
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": ["none", "counter"],
38
+ "enum": [
39
+ "none",
40
+ "counter"
41
+ ],
20
42
  "default": "none"
21
43
  },
22
- "resetOnNew": { "type": "boolean", "default": true },
23
- "queryPrefix": { "type": "string", "description": "Prefix added to search queries" },
24
- "maxQueryChars": { "type": "integer", "description": "Max chars for search query" },
25
- "recallEnabled": { "type": "boolean", "default": true },
26
- "recallGlobal": { "type": "boolean", "default": true },
27
- "addEnabled": { "type": "boolean", "default": true },
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": ["last_turn", "full_session"],
70
+ "enum": [
71
+ "last_turn",
72
+ "full_session"
73
+ ],
31
74
  "default": "last_turn"
32
75
  },
33
- "maxMessageChars": { "type": "integer", "description": "Max chars per message when adding", "default": 20000 },
34
- "includeAssistant": { "type": "boolean", "default": true },
35
- "memoryLimitNumber": { "type": "integer", "default": 6 },
36
- "preferenceLimitNumber": { "type": "integer", "default": 6 },
37
- "includePreference": { "type": "boolean", "default": true },
38
- "includeToolMemory": { "type": "boolean", "default": false },
39
- "toolMemoryLimitNumber": { "type": "integer", "default": 6 },
40
- "filter": { "type": "object", "description": "MemOS search filter" },
41
- "knowledgebaseIds": { "type": "array", "items": { "type": "string" } },
42
- "tags": { "type": "array", "items": { "type": "string" } },
43
- "info": { "type": "object", "additionalProperties": true },
44
- "agentId": { "type": "string" },
45
- "appId": { "type": "string" },
46
- "allowPublic": { "type": "boolean", "default": false },
47
- "allowKnowledgebaseIds": { "type": "array", "items": { "type": "string" } },
48
- "asyncMode": { "type": "boolean", "default": true },
49
- "timeoutMs": { "type": "integer", "default": 5000 },
50
- "retries": { "type": "integer", "default": 1 },
51
- "throttleMs": { "type": "integer", "default": 0 }
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",
3
+ "version": "0.1.5-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": ["./index.js"]
32
+ "extensions": [
33
+ "./index.js"
34
+ ]
25
35
  },
26
36
  "clawdbot": {
27
- "extensions": ["./index.js"]
37
+ "extensions": [
38
+ "./index.js"
39
+ ]
28
40
  },
29
41
  "moltbot": {
30
- "extensions": ["./index.js"]
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.');