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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "natureco-cli",
3
- "version": "2.12.7",
3
+ "version": "2.12.8",
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.7</div>
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.7',
344
+ version: 'v2.12.8',
345
345
  bots: cfg.bots || [],
346
346
  telegramToken: cfg.telegramToken || null,
347
347
  whatsappConnected: cfg.whatsappConnected || false,
@@ -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
- // C:\Users\user\.openclaw\ ~/.natureco/
118
- content = content.replace(/C:\\Users\\[^\\]+\\.openclaw\\/g, '~/.natureco/');
119
- // E:\.openclaw\ → ~/.natureco/
120
- content = content.replace(/E:\\.openclaw\\/g, '~/.natureco/');
121
- // C:\Users\user\ → ~/
122
- content = content.replace(/C:\\Users\\[^\\]+\\/g, '~/');
123
- // General .openclaw path fix
124
- content = content.replace(/\\.openclaw\\/g, '/.natureco/');
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
- // "node C:\Users\user\.openclaw\workspace\scripts\xxx.js" "node ~/.natureco/workspace/scripts/xxx.js"
182
- prompt = prompt.replace(/C:\\Users\\[^\\]+\\.openclaw\\/g, '~/.natureco/');
183
- prompt = prompt.replace(/E:\\.openclaw\\/g, '~/.natureco/');
184
- prompt = prompt.replace(/C:\\Users\\[^\\]+\\/g, '~/');
185
- prompt = prompt.replace(/\\.openclaw\\/g, '/.natureco/');
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);