natureco-cli 2.12.9 → 2.13.1

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "natureco-cli",
3
- "version": "2.12.9",
3
+ "version": "2.13.1",
4
4
  "description": "NatureCo AI Bot Terminal Interface",
5
5
  "main": "bin/natureco.js",
6
6
  "bin": {
@@ -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.9</div>
214
+ <div class="version-badge" id="version-badge">v2.13.1</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.9',
344
+ version: 'v2.13.1',
345
345
  bots: cfg.bots || [],
346
346
  telegramToken: cfg.telegramToken || null,
347
347
  whatsappConnected: cfg.whatsappConnected || false,
@@ -118,11 +118,22 @@ async function migrate(options) {
118
118
  // First, convert all backslashes to forward slashes
119
119
  content = content.replace(/\\/g, '/');
120
120
 
121
- // Then normalize Windows path patterns
121
+ // Then normalize Windows path patterns (comprehensive)
122
+ // Handle escaped backslashes in strings (C:\\\\Users\\\\user\\\\ → homedir/)
122
123
  content = content
123
- .replace(/C:\/Users\/user\/\.openclaw\//g, `${os.homedir()}/.natureco/`)
124
- .replace(/E:\/\.openclaw\//g, `${os.homedir()}/.natureco/`)
124
+ .replace(/C:\/\/\/\/Users\/\/\/\/user\/\/\/\//g, `${os.homedir()}/`)
125
+ .replace(/C:\/Users\/user\//g, `${os.homedir()}/`)
125
126
  .replace(/C:\/Users\/user\//g, `${os.homedir()}/`)
127
+ // Double slash versions (escaped in strings)
128
+ .replace(/C:\/\/Users\/\/user\/\/\.natureco\/\//g, `${os.homedir()}/.natureco/`)
129
+ .replace(/C:\/\/Users\/\/user\/\//g, `${os.homedir()}/`)
130
+ .replace(/E:\/\/\.natureco\/\//g, `${os.homedir()}/.natureco/`)
131
+ // String literals with quotes
132
+ .replace(/'C:\/Users\/user\/\.natureco\//g, `'${os.homedir()}/.natureco/`)
133
+ .replace(/"C:\/Users\/user\/\.natureco\//g, `"${os.homedir()}/.natureco/`)
134
+ .replace(/'C:\/\/\/\/Users\/\/\/\/user\/\/\/\/\.natureco\/\/\/\//g, `'${os.homedir()}/.natureco/`)
135
+ // General patterns
136
+ .replace(/E:\/\.openclaw\//g, `${os.homedir()}/.natureco/`)
126
137
  .replace(/\.openclaw\//g, '.natureco/')
127
138
  .replace(/workspace\/scripts\\/g, 'workspace/scripts/');
128
139
  }
@@ -212,16 +223,26 @@ async function migrate(options) {
212
223
  // Get prompt (max 300 chars)
213
224
  let prompt = job.payload?.message || '';
214
225
 
215
- // Fix Windows paths in prompts
226
+ // Fix Windows paths in prompts (comprehensive)
216
227
  // First, convert all backslashes to forward slashes
217
228
  prompt = prompt.replace(/\\/g, '/');
218
229
 
219
230
  // Then normalize Windows path patterns
220
- // "node C:/Users/user/.openclaw/workspace/scripts/xxx.js" "node ~/.natureco/workspace/scripts/xxx.js"
231
+ // Handle escaped backslashes and string literals
221
232
  prompt = prompt
222
- .replace(/C:\/Users\/user\/\.openclaw\//g, `${os.homedir()}/.natureco/`)
223
- .replace(/E:\/\.openclaw\//g, `${os.homedir()}/.natureco/`)
233
+ .replace(/C:\/\/\/\/Users\/\/\/\/user\/\/\/\//g, `${os.homedir()}/`)
234
+ .replace(/C:\/Users\/user\//g, `${os.homedir()}/`)
224
235
  .replace(/C:\/Users\/user\//g, `${os.homedir()}/`)
236
+ // Double slash versions (escaped in strings)
237
+ .replace(/C:\/\/Users\/\/user\/\/\.natureco\/\//g, `${os.homedir()}/.natureco/`)
238
+ .replace(/C:\/\/Users\/\/user\/\//g, `${os.homedir()}/`)
239
+ .replace(/E:\/\/\.natureco\/\//g, `${os.homedir()}/.natureco/`)
240
+ // String literals with quotes
241
+ .replace(/'C:\/Users\/user\/\.natureco\//g, `'${os.homedir()}/.natureco/`)
242
+ .replace(/"C:\/Users\/user\/\.natureco\//g, `"${os.homedir()}/.natureco/`)
243
+ .replace(/'C:\/\/\/\/Users\/\/\/\/user\/\/\/\/\.natureco\/\/\/\//g, `'${os.homedir()}/.natureco/`)
244
+ // General patterns
245
+ .replace(/E:\/\.openclaw\//g, `${os.homedir()}/.natureco/`)
225
246
  .replace(/\.openclaw\//g, '.natureco/')
226
247
  .replace(/workspace\/scripts\\/g, 'workspace/scripts/');
227
248