natureco-cli 2.12.7 → 2.12.8
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/package.json +1 -1
- package/src/commands/dashboard.js +2 -2
- package/src/commands/migrate.js +21 -13
package/package.json
CHANGED
|
@@ -211,7 +211,7 @@ body::before{
|
|
|
211
211
|
<div class="header-bot-name" id="header-bot-name">Nature Bot</div>
|
|
212
212
|
<div class="header-bot-model" id="header-bot-model">NatureCo</div>
|
|
213
213
|
</div>
|
|
214
|
-
<div class="version-badge" id="version-badge">v2.12.
|
|
214
|
+
<div class="version-badge" id="version-badge">v2.12.8</div>
|
|
215
215
|
</div>
|
|
216
216
|
<div class="messages" id="messages"></div>
|
|
217
217
|
<div class="input-area">
|
|
@@ -341,7 +341,7 @@ function dashboard(action) {
|
|
|
341
341
|
apiKey: cfg.apiKey,
|
|
342
342
|
defaultBot: cfg.defaultBot,
|
|
343
343
|
defaultBotId: cfg.defaultBotId,
|
|
344
|
-
version: 'v2.12.
|
|
344
|
+
version: 'v2.12.8',
|
|
345
345
|
bots: cfg.bots || [],
|
|
346
346
|
telegramToken: cfg.telegramToken || null,
|
|
347
347
|
whatsappConnected: cfg.whatsappConnected || false,
|
package/src/commands/migrate.js
CHANGED
|
@@ -114,14 +114,16 @@ async function migrate(options) {
|
|
|
114
114
|
|
|
115
115
|
// Fix Windows paths in .js files
|
|
116
116
|
if (file.endsWith('.js')) {
|
|
117
|
-
//
|
|
118
|
-
content = content.replace(
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
117
|
+
// First, convert all backslashes to forward slashes
|
|
118
|
+
content = content.replace(/\\/g, '/');
|
|
119
|
+
|
|
120
|
+
// Then normalize Windows path patterns
|
|
121
|
+
content = content
|
|
122
|
+
.replace(/C:\/Users\/user\/\.openclaw\//g, `${os.homedir()}/.natureco/`)
|
|
123
|
+
.replace(/E:\/\.openclaw\//g, `${os.homedir()}/.natureco/`)
|
|
124
|
+
.replace(/C:\/Users\/user\//g, `${os.homedir()}/`)
|
|
125
|
+
.replace(/\.openclaw\//g, '.natureco/')
|
|
126
|
+
.replace(/workspace\/scripts\\/g, 'workspace/scripts/');
|
|
125
127
|
}
|
|
126
128
|
|
|
127
129
|
// Write fixed content
|
|
@@ -178,11 +180,17 @@ async function migrate(options) {
|
|
|
178
180
|
let prompt = job.payload?.message || '';
|
|
179
181
|
|
|
180
182
|
// Fix Windows paths in prompts
|
|
181
|
-
//
|
|
182
|
-
prompt = prompt.replace(
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
183
|
+
// First, convert all backslashes to forward slashes
|
|
184
|
+
prompt = prompt.replace(/\\/g, '/');
|
|
185
|
+
|
|
186
|
+
// Then normalize Windows path patterns
|
|
187
|
+
// "node C:/Users/user/.openclaw/workspace/scripts/xxx.js" → "node ~/.natureco/workspace/scripts/xxx.js"
|
|
188
|
+
prompt = prompt
|
|
189
|
+
.replace(/C:\/Users\/user\/\.openclaw\//g, `${os.homedir()}/.natureco/`)
|
|
190
|
+
.replace(/E:\/\.openclaw\//g, `${os.homedir()}/.natureco/`)
|
|
191
|
+
.replace(/C:\/Users\/user\//g, `${os.homedir()}/`)
|
|
192
|
+
.replace(/\.openclaw\//g, '.natureco/')
|
|
193
|
+
.replace(/workspace\/scripts\\/g, 'workspace/scripts/');
|
|
186
194
|
|
|
187
195
|
if (prompt.length > 300) {
|
|
188
196
|
prompt = prompt.slice(0, 300);
|