@memtensor/memos-cloud-openclaw-plugin 0.1.11 → 0.1.12-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/HOOK.md +22 -0
- package/LICENSE +201 -201
- package/README.md +316 -317
- package/README_ZH.md +321 -322
- package/clawdbot.plugin.json +49 -61
- package/index.js +544 -527
- package/lib/arms-reporter.js +116 -0
- package/lib/check-update.js +187 -270
- package/lib/config-resolution-schema.js +50 -0
- package/lib/config-ui/app.css +920 -0
- package/lib/config-ui/app.js +1290 -0
- package/lib/config-ui/icon.svg +1 -0
- package/lib/config-ui/index.html +112 -0
- package/lib/config-ui-server.js +713 -0
- package/lib/memos-cloud-api.js +848 -790
- package/moltbot.plugin.json +49 -61
- package/openclaw.plugin.json +49 -61
- package/package.json +55 -46
- package/scripts/sync-version.js +45 -45
- package/test/direct-session-user-id.test.mjs +94 -94
- package/test/query-strip.test.mjs +381 -381
package/moltbot.plugin.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
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.12-beta.0",
|
|
6
6
|
"kind": "lifecycle",
|
|
7
7
|
"main": "./index.js",
|
|
8
8
|
"configSchema": {
|
|
@@ -18,8 +18,7 @@
|
|
|
18
18
|
},
|
|
19
19
|
"userId": {
|
|
20
20
|
"type": "string",
|
|
21
|
-
"description": "MemOS user_id (default: openclaw-user)"
|
|
22
|
-
"default": "openclaw-user"
|
|
21
|
+
"description": "MemOS user_id (default: openclaw-user)"
|
|
23
22
|
},
|
|
24
23
|
"conversationId": {
|
|
25
24
|
"type": "string",
|
|
@@ -38,17 +37,14 @@
|
|
|
38
37
|
"enum": [
|
|
39
38
|
"none",
|
|
40
39
|
"counter"
|
|
41
|
-
]
|
|
42
|
-
"default": "none"
|
|
40
|
+
]
|
|
43
41
|
},
|
|
44
42
|
"useDirectSessionUserId": {
|
|
45
43
|
"type": "boolean",
|
|
46
|
-
"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."
|
|
47
|
-
"default": false
|
|
44
|
+
"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."
|
|
48
45
|
},
|
|
49
46
|
"resetOnNew": {
|
|
50
|
-
"type": "boolean"
|
|
51
|
-
"default": true
|
|
47
|
+
"type": "boolean"
|
|
52
48
|
},
|
|
53
49
|
"queryPrefix": {
|
|
54
50
|
"type": "string",
|
|
@@ -63,8 +59,37 @@
|
|
|
63
59
|
"default": true
|
|
64
60
|
},
|
|
65
61
|
"recallGlobal": {
|
|
66
|
-
"type": "boolean"
|
|
67
|
-
|
|
62
|
+
"type": "boolean"
|
|
63
|
+
},
|
|
64
|
+
"recallFilterEnabled": {
|
|
65
|
+
"type": "boolean"
|
|
66
|
+
},
|
|
67
|
+
"recallFilterBaseUrl": {
|
|
68
|
+
"type": "string",
|
|
69
|
+
"description": "OpenAI-compatible base URL for recall filter model"
|
|
70
|
+
},
|
|
71
|
+
"recallFilterApiKey": {
|
|
72
|
+
"type": "string",
|
|
73
|
+
"description": "API key for recall filter model endpoint"
|
|
74
|
+
},
|
|
75
|
+
"recallFilterModel": {
|
|
76
|
+
"type": "string",
|
|
77
|
+
"description": "Model name used to filter recall candidates"
|
|
78
|
+
},
|
|
79
|
+
"recallFilterTimeoutMs": {
|
|
80
|
+
"type": "integer"
|
|
81
|
+
},
|
|
82
|
+
"recallFilterRetries": {
|
|
83
|
+
"type": "integer"
|
|
84
|
+
},
|
|
85
|
+
"recallFilterCandidateLimit": {
|
|
86
|
+
"type": "integer"
|
|
87
|
+
},
|
|
88
|
+
"recallFilterMaxItemChars": {
|
|
89
|
+
"type": "integer"
|
|
90
|
+
},
|
|
91
|
+
"recallFilterFailOpen": {
|
|
92
|
+
"type": "boolean"
|
|
68
93
|
},
|
|
69
94
|
"addEnabled": {
|
|
70
95
|
"type": "boolean",
|
|
@@ -75,13 +100,11 @@
|
|
|
75
100
|
"enum": [
|
|
76
101
|
"last_turn",
|
|
77
102
|
"full_session"
|
|
78
|
-
]
|
|
79
|
-
"default": "last_turn"
|
|
103
|
+
]
|
|
80
104
|
},
|
|
81
105
|
"maxMessageChars": {
|
|
82
106
|
"type": "integer",
|
|
83
|
-
"description": "Max chars per message when adding"
|
|
84
|
-
"default": 20000
|
|
107
|
+
"description": "Max chars per message when adding"
|
|
85
108
|
},
|
|
86
109
|
"maxItemChars": {
|
|
87
110
|
"type": "integer",
|
|
@@ -89,12 +112,11 @@
|
|
|
89
112
|
"default": 8000
|
|
90
113
|
},
|
|
91
114
|
"includeAssistant": {
|
|
92
|
-
"type": "boolean"
|
|
93
|
-
"default": true
|
|
115
|
+
"type": "boolean"
|
|
94
116
|
},
|
|
95
117
|
"memoryLimitNumber": {
|
|
96
118
|
"type": "integer",
|
|
97
|
-
"default":
|
|
119
|
+
"default": 9
|
|
98
120
|
},
|
|
99
121
|
"preferenceLimitNumber": {
|
|
100
122
|
"type": "integer",
|
|
@@ -112,50 +134,15 @@
|
|
|
112
134
|
"type": "integer",
|
|
113
135
|
"default": 6
|
|
114
136
|
},
|
|
137
|
+
"relativity": {
|
|
138
|
+
"type": "number",
|
|
139
|
+
"description": "Minimum relativity score required before a recalled item is injected"
|
|
140
|
+
},
|
|
115
141
|
"filter": {
|
|
116
142
|
"type": "object",
|
|
117
143
|
"description": "MemOS search filter",
|
|
118
144
|
"additionalProperties": true
|
|
119
145
|
},
|
|
120
|
-
"relativity": {
|
|
121
|
-
"type": "number",
|
|
122
|
-
"description": "Search relativity threshold",
|
|
123
|
-
"default": 0.45
|
|
124
|
-
},
|
|
125
|
-
"recallFilterEnabled": {
|
|
126
|
-
"type": "boolean",
|
|
127
|
-
"default": false
|
|
128
|
-
},
|
|
129
|
-
"recallFilterBaseUrl": {
|
|
130
|
-
"type": "string",
|
|
131
|
-
"description": "OpenAI-compatible API base URL for recall filtering"
|
|
132
|
-
},
|
|
133
|
-
"recallFilterApiKey": {
|
|
134
|
-
"type": "string"
|
|
135
|
-
},
|
|
136
|
-
"recallFilterModel": {
|
|
137
|
-
"type": "string"
|
|
138
|
-
},
|
|
139
|
-
"recallFilterTimeoutMs": {
|
|
140
|
-
"type": "integer",
|
|
141
|
-
"default": 30000
|
|
142
|
-
},
|
|
143
|
-
"recallFilterRetries": {
|
|
144
|
-
"type": "integer",
|
|
145
|
-
"default": 1
|
|
146
|
-
},
|
|
147
|
-
"recallFilterCandidateLimit": {
|
|
148
|
-
"type": "integer",
|
|
149
|
-
"default": 30
|
|
150
|
-
},
|
|
151
|
-
"recallFilterMaxItemChars": {
|
|
152
|
-
"type": "integer",
|
|
153
|
-
"default": 500
|
|
154
|
-
},
|
|
155
|
-
"recallFilterFailOpen": {
|
|
156
|
-
"type": "boolean",
|
|
157
|
-
"default": true
|
|
158
|
-
},
|
|
159
146
|
"knowledgebaseIds": {
|
|
160
147
|
"type": "array",
|
|
161
148
|
"items": {
|
|
@@ -176,8 +163,7 @@
|
|
|
176
163
|
"type": "string"
|
|
177
164
|
},
|
|
178
165
|
"multiAgentMode": {
|
|
179
|
-
"type": "boolean"
|
|
180
|
-
"default": false
|
|
166
|
+
"type": "boolean"
|
|
181
167
|
},
|
|
182
168
|
"allowedAgents": {
|
|
183
169
|
"type": "array",
|
|
@@ -200,6 +186,9 @@
|
|
|
200
186
|
}
|
|
201
187
|
},
|
|
202
188
|
"asyncMode": {
|
|
189
|
+
"type": "boolean"
|
|
190
|
+
},
|
|
191
|
+
"rumEnabled": {
|
|
203
192
|
"type": "boolean",
|
|
204
193
|
"default": true
|
|
205
194
|
},
|
|
@@ -212,8 +201,7 @@
|
|
|
212
201
|
"default": 1
|
|
213
202
|
},
|
|
214
203
|
"throttleMs": {
|
|
215
|
-
"type": "integer"
|
|
216
|
-
"default": 0
|
|
204
|
+
"type": "integer"
|
|
217
205
|
},
|
|
218
206
|
"agentOverrides": {
|
|
219
207
|
"type": "object",
|
package/openclaw.plugin.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
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.12-beta.0",
|
|
6
6
|
"kind": "lifecycle",
|
|
7
7
|
"main": "./index.js",
|
|
8
8
|
"configSchema": {
|
|
@@ -18,8 +18,7 @@
|
|
|
18
18
|
},
|
|
19
19
|
"userId": {
|
|
20
20
|
"type": "string",
|
|
21
|
-
"description": "MemOS user_id (default: openclaw-user)"
|
|
22
|
-
"default": "openclaw-user"
|
|
21
|
+
"description": "MemOS user_id (default: openclaw-user)"
|
|
23
22
|
},
|
|
24
23
|
"conversationId": {
|
|
25
24
|
"type": "string",
|
|
@@ -38,17 +37,14 @@
|
|
|
38
37
|
"enum": [
|
|
39
38
|
"none",
|
|
40
39
|
"counter"
|
|
41
|
-
]
|
|
42
|
-
"default": "none"
|
|
40
|
+
]
|
|
43
41
|
},
|
|
44
42
|
"useDirectSessionUserId": {
|
|
45
43
|
"type": "boolean",
|
|
46
|
-
"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."
|
|
47
|
-
"default": false
|
|
44
|
+
"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."
|
|
48
45
|
},
|
|
49
46
|
"resetOnNew": {
|
|
50
|
-
"type": "boolean"
|
|
51
|
-
"default": true
|
|
47
|
+
"type": "boolean"
|
|
52
48
|
},
|
|
53
49
|
"queryPrefix": {
|
|
54
50
|
"type": "string",
|
|
@@ -63,8 +59,37 @@
|
|
|
63
59
|
"default": true
|
|
64
60
|
},
|
|
65
61
|
"recallGlobal": {
|
|
66
|
-
"type": "boolean"
|
|
67
|
-
|
|
62
|
+
"type": "boolean"
|
|
63
|
+
},
|
|
64
|
+
"recallFilterEnabled": {
|
|
65
|
+
"type": "boolean"
|
|
66
|
+
},
|
|
67
|
+
"recallFilterBaseUrl": {
|
|
68
|
+
"type": "string",
|
|
69
|
+
"description": "OpenAI-compatible base URL for recall filter model"
|
|
70
|
+
},
|
|
71
|
+
"recallFilterApiKey": {
|
|
72
|
+
"type": "string",
|
|
73
|
+
"description": "API key for recall filter model endpoint"
|
|
74
|
+
},
|
|
75
|
+
"recallFilterModel": {
|
|
76
|
+
"type": "string",
|
|
77
|
+
"description": "Model name used to filter recall candidates"
|
|
78
|
+
},
|
|
79
|
+
"recallFilterTimeoutMs": {
|
|
80
|
+
"type": "integer"
|
|
81
|
+
},
|
|
82
|
+
"recallFilterRetries": {
|
|
83
|
+
"type": "integer"
|
|
84
|
+
},
|
|
85
|
+
"recallFilterCandidateLimit": {
|
|
86
|
+
"type": "integer"
|
|
87
|
+
},
|
|
88
|
+
"recallFilterMaxItemChars": {
|
|
89
|
+
"type": "integer"
|
|
90
|
+
},
|
|
91
|
+
"recallFilterFailOpen": {
|
|
92
|
+
"type": "boolean"
|
|
68
93
|
},
|
|
69
94
|
"addEnabled": {
|
|
70
95
|
"type": "boolean",
|
|
@@ -75,13 +100,11 @@
|
|
|
75
100
|
"enum": [
|
|
76
101
|
"last_turn",
|
|
77
102
|
"full_session"
|
|
78
|
-
]
|
|
79
|
-
"default": "last_turn"
|
|
103
|
+
]
|
|
80
104
|
},
|
|
81
105
|
"maxMessageChars": {
|
|
82
106
|
"type": "integer",
|
|
83
|
-
"description": "Max chars per message when adding"
|
|
84
|
-
"default": 20000
|
|
107
|
+
"description": "Max chars per message when adding"
|
|
85
108
|
},
|
|
86
109
|
"maxItemChars": {
|
|
87
110
|
"type": "integer",
|
|
@@ -89,12 +112,11 @@
|
|
|
89
112
|
"default": 8000
|
|
90
113
|
},
|
|
91
114
|
"includeAssistant": {
|
|
92
|
-
"type": "boolean"
|
|
93
|
-
"default": true
|
|
115
|
+
"type": "boolean"
|
|
94
116
|
},
|
|
95
117
|
"memoryLimitNumber": {
|
|
96
118
|
"type": "integer",
|
|
97
|
-
"default":
|
|
119
|
+
"default": 9
|
|
98
120
|
},
|
|
99
121
|
"preferenceLimitNumber": {
|
|
100
122
|
"type": "integer",
|
|
@@ -112,50 +134,15 @@
|
|
|
112
134
|
"type": "integer",
|
|
113
135
|
"default": 6
|
|
114
136
|
},
|
|
137
|
+
"relativity": {
|
|
138
|
+
"type": "number",
|
|
139
|
+
"description": "Minimum relativity score required before a recalled item is injected"
|
|
140
|
+
},
|
|
115
141
|
"filter": {
|
|
116
142
|
"type": "object",
|
|
117
143
|
"description": "MemOS search filter",
|
|
118
144
|
"additionalProperties": true
|
|
119
145
|
},
|
|
120
|
-
"relativity": {
|
|
121
|
-
"type": "number",
|
|
122
|
-
"description": "Search relativity threshold",
|
|
123
|
-
"default": 0.45
|
|
124
|
-
},
|
|
125
|
-
"recallFilterEnabled": {
|
|
126
|
-
"type": "boolean",
|
|
127
|
-
"default": false
|
|
128
|
-
},
|
|
129
|
-
"recallFilterBaseUrl": {
|
|
130
|
-
"type": "string",
|
|
131
|
-
"description": "OpenAI-compatible API base URL for recall filtering"
|
|
132
|
-
},
|
|
133
|
-
"recallFilterApiKey": {
|
|
134
|
-
"type": "string"
|
|
135
|
-
},
|
|
136
|
-
"recallFilterModel": {
|
|
137
|
-
"type": "string"
|
|
138
|
-
},
|
|
139
|
-
"recallFilterTimeoutMs": {
|
|
140
|
-
"type": "integer",
|
|
141
|
-
"default": 30000
|
|
142
|
-
},
|
|
143
|
-
"recallFilterRetries": {
|
|
144
|
-
"type": "integer",
|
|
145
|
-
"default": 1
|
|
146
|
-
},
|
|
147
|
-
"recallFilterCandidateLimit": {
|
|
148
|
-
"type": "integer",
|
|
149
|
-
"default": 30
|
|
150
|
-
},
|
|
151
|
-
"recallFilterMaxItemChars": {
|
|
152
|
-
"type": "integer",
|
|
153
|
-
"default": 500
|
|
154
|
-
},
|
|
155
|
-
"recallFilterFailOpen": {
|
|
156
|
-
"type": "boolean",
|
|
157
|
-
"default": true
|
|
158
|
-
},
|
|
159
146
|
"knowledgebaseIds": {
|
|
160
147
|
"type": "array",
|
|
161
148
|
"items": {
|
|
@@ -176,8 +163,7 @@
|
|
|
176
163
|
"type": "string"
|
|
177
164
|
},
|
|
178
165
|
"multiAgentMode": {
|
|
179
|
-
"type": "boolean"
|
|
180
|
-
"default": false
|
|
166
|
+
"type": "boolean"
|
|
181
167
|
},
|
|
182
168
|
"allowedAgents": {
|
|
183
169
|
"type": "array",
|
|
@@ -200,6 +186,9 @@
|
|
|
200
186
|
}
|
|
201
187
|
},
|
|
202
188
|
"asyncMode": {
|
|
189
|
+
"type": "boolean"
|
|
190
|
+
},
|
|
191
|
+
"rumEnabled": {
|
|
203
192
|
"type": "boolean",
|
|
204
193
|
"default": true
|
|
205
194
|
},
|
|
@@ -212,8 +201,7 @@
|
|
|
212
201
|
"default": 1
|
|
213
202
|
},
|
|
214
203
|
"throttleMs": {
|
|
215
|
-
"type": "integer"
|
|
216
|
-
"default": 0
|
|
204
|
+
"type": "integer"
|
|
217
205
|
},
|
|
218
206
|
"agentOverrides": {
|
|
219
207
|
"type": "object",
|
package/package.json
CHANGED
|
@@ -1,46 +1,55 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@memtensor/memos-cloud-openclaw-plugin",
|
|
3
|
-
"version": "0.1.
|
|
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
|
-
},
|
|
13
|
-
"keywords": [
|
|
14
|
-
"memos",
|
|
15
|
-
"memos-cloud",
|
|
16
|
-
"openclaw",
|
|
17
|
-
"plugin",
|
|
18
|
-
"memory"
|
|
19
|
-
],
|
|
20
|
-
"homepage": "https://github.com/MemTensor/MemOS-Cloud-OpenClaw-Plugin#readme",
|
|
21
|
-
"bugs": {
|
|
22
|
-
"url": "https://github.com/MemTensor/MemOS-Cloud-OpenClaw-Plugin/issues"
|
|
23
|
-
},
|
|
24
|
-
"repository": {
|
|
25
|
-
"type": "git",
|
|
26
|
-
"url": "git+https://github.com/MemTensor/MemOS-Cloud-OpenClaw-Plugin.git"
|
|
27
|
-
},
|
|
28
|
-
"type": "module",
|
|
29
|
-
"author": "MemTensor",
|
|
30
|
-
"license": "MIT",
|
|
31
|
-
"openclaw": {
|
|
32
|
-
"
|
|
33
|
-
"./index.js"
|
|
34
|
-
]
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@memtensor/memos-cloud-openclaw-plugin",
|
|
3
|
+
"version": "0.1.12-beta.0",
|
|
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
|
+
},
|
|
13
|
+
"keywords": [
|
|
14
|
+
"memos",
|
|
15
|
+
"memos-cloud",
|
|
16
|
+
"openclaw",
|
|
17
|
+
"plugin",
|
|
18
|
+
"memory"
|
|
19
|
+
],
|
|
20
|
+
"homepage": "https://github.com/MemTensor/MemOS-Cloud-OpenClaw-Plugin#readme",
|
|
21
|
+
"bugs": {
|
|
22
|
+
"url": "https://github.com/MemTensor/MemOS-Cloud-OpenClaw-Plugin/issues"
|
|
23
|
+
},
|
|
24
|
+
"repository": {
|
|
25
|
+
"type": "git",
|
|
26
|
+
"url": "git+https://github.com/MemTensor/MemOS-Cloud-OpenClaw-Plugin.git"
|
|
27
|
+
},
|
|
28
|
+
"type": "module",
|
|
29
|
+
"author": "MemTensor",
|
|
30
|
+
"license": "MIT",
|
|
31
|
+
"openclaw": {
|
|
32
|
+
"hooks": [
|
|
33
|
+
"./index.js"
|
|
34
|
+
],
|
|
35
|
+
"extensions": [
|
|
36
|
+
"./index.js"
|
|
37
|
+
]
|
|
38
|
+
},
|
|
39
|
+
"clawdbot": {
|
|
40
|
+
"hooks": [
|
|
41
|
+
"./index.js"
|
|
42
|
+
],
|
|
43
|
+
"extensions": [
|
|
44
|
+
"./index.js"
|
|
45
|
+
]
|
|
46
|
+
},
|
|
47
|
+
"moltbot": {
|
|
48
|
+
"hooks": [
|
|
49
|
+
"./index.js"
|
|
50
|
+
],
|
|
51
|
+
"extensions": [
|
|
52
|
+
"./index.js"
|
|
53
|
+
]
|
|
54
|
+
}
|
|
55
|
+
}
|
package/scripts/sync-version.js
CHANGED
|
@@ -1,45 +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.');
|
|
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.');
|