natureco-cli 2.13.4 → 2.13.6
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 +51 -4
- package/src/utils/api.js +20 -0
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.13.
|
|
214
|
+
<div class="version-badge" id="version-badge">v2.13.6</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.13.
|
|
344
|
+
version: 'v2.13.6',
|
|
345
345
|
bots: cfg.bots || [],
|
|
346
346
|
telegramToken: cfg.telegramToken || null,
|
|
347
347
|
whatsappConnected: cfg.whatsappConnected || false,
|
package/src/commands/migrate.js
CHANGED
|
@@ -16,6 +16,21 @@ function normalizeWhatsAppNumber(target) {
|
|
|
16
16
|
return match ? '+' + match[1] : target;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
+
/**
|
|
20
|
+
* Add unique fact to facts array (prevent duplicates)
|
|
21
|
+
*/
|
|
22
|
+
function addUniqueFact(facts, newFact) {
|
|
23
|
+
const exists = facts.some(f => {
|
|
24
|
+
const existingVal = typeof f === 'string' ? f : f.value;
|
|
25
|
+
const newVal = typeof newFact === 'string' ? newFact : newFact.value;
|
|
26
|
+
return existingVal === newVal;
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
if (!exists) {
|
|
30
|
+
facts.push(newFact);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
19
34
|
async function migrate(options) {
|
|
20
35
|
const from = options.from || 'openclaw';
|
|
21
36
|
|
|
@@ -45,6 +60,7 @@ async function migrate(options) {
|
|
|
45
60
|
telegram: null,
|
|
46
61
|
whatsapp: false,
|
|
47
62
|
scripts: 0,
|
|
63
|
+
skills: 0,
|
|
48
64
|
};
|
|
49
65
|
|
|
50
66
|
// 1. Memory migration
|
|
@@ -71,7 +87,7 @@ async function migrate(options) {
|
|
|
71
87
|
|
|
72
88
|
if (timezoneMatch) {
|
|
73
89
|
let timezone = timezoneMatch[1].trim().replace(/\*\*/g, '').trim();
|
|
74
|
-
memory.facts
|
|
90
|
+
addUniqueFact(memory.facts, {
|
|
75
91
|
value: `Timezone: ${timezone}`,
|
|
76
92
|
score: 6,
|
|
77
93
|
updatedAt: new Date().toISOString().split('T')[0]
|
|
@@ -80,7 +96,7 @@ async function migrate(options) {
|
|
|
80
96
|
|
|
81
97
|
if (notesMatch) {
|
|
82
98
|
let notes = notesMatch[1].trim().replace(/\*\*/g, '').trim();
|
|
83
|
-
memory.facts
|
|
99
|
+
addUniqueFact(memory.facts, {
|
|
84
100
|
value: notes,
|
|
85
101
|
score: 6,
|
|
86
102
|
updatedAt: new Date().toISOString().split('T')[0]
|
|
@@ -130,7 +146,7 @@ async function migrate(options) {
|
|
|
130
146
|
|
|
131
147
|
// Add first 30 lines as facts (max 200 chars each)
|
|
132
148
|
for (const line of lines.slice(0, 30)) {
|
|
133
|
-
memory.facts
|
|
149
|
+
addUniqueFact(memory.facts, {
|
|
134
150
|
value: line.slice(0, 200),
|
|
135
151
|
score: 6,
|
|
136
152
|
updatedAt: new Date().toISOString().split('T')[0]
|
|
@@ -401,8 +417,39 @@ async function migrate(options) {
|
|
|
401
417
|
console.log(chalk.gray('⚠️ WhatsApp session migration atlandı:', err.message));
|
|
402
418
|
}
|
|
403
419
|
|
|
420
|
+
// 5. Skills migration
|
|
421
|
+
try {
|
|
422
|
+
const openclawSkillsDir = path.join(openclawDir, 'workspace', 'skills');
|
|
423
|
+
const naturecSkillsDir = path.join(os.homedir(), '.natureco', 'skills');
|
|
424
|
+
|
|
425
|
+
if (fs.existsSync(openclawSkillsDir)) {
|
|
426
|
+
fs.mkdirSync(naturecSkillsDir, { recursive: true });
|
|
427
|
+
|
|
428
|
+
const skills = fs.readdirSync(openclawSkillsDir);
|
|
429
|
+
|
|
430
|
+
for (const skill of skills) {
|
|
431
|
+
const src = path.join(openclawSkillsDir, skill);
|
|
432
|
+
const dst = path.join(naturecSkillsDir, skill);
|
|
433
|
+
|
|
434
|
+
// Skip if not a directory
|
|
435
|
+
if (!fs.statSync(src).isDirectory()) continue;
|
|
436
|
+
|
|
437
|
+
// Copy directory recursively
|
|
438
|
+
fs.cpSync(src, dst, { recursive: true });
|
|
439
|
+
report.skills++;
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
if (report.skills > 0) {
|
|
443
|
+
console.log(chalk.green(`✅ Skills: ${report.skills} skill migrate edildi`));
|
|
444
|
+
console.log(chalk.gray(` Konum: ~/.natureco/skills/`));
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
} catch (err) {
|
|
448
|
+
console.log(chalk.gray('⚠️ Skills migration atlandı:', err.message));
|
|
449
|
+
}
|
|
450
|
+
|
|
404
451
|
// Print migration report
|
|
405
|
-
console.log(chalk.green('✅ Migration tamamlandı!\n'));
|
|
452
|
+
console.log(chalk.green('\n✅ Migration tamamlandı!\n'));
|
|
406
453
|
|
|
407
454
|
if (report.memory) {
|
|
408
455
|
// Extract string facts for display (handle both string and object formats)
|
package/src/utils/api.js
CHANGED
|
@@ -736,6 +736,26 @@ TOOL SELECTION GUIDE:
|
|
|
736
736
|
systemPrompt += `\n\nFor GitHub MCP, prefer list_issues over search_issues when listing issues.`;
|
|
737
737
|
}
|
|
738
738
|
|
|
739
|
+
// Add available skills information
|
|
740
|
+
const skillsDir = path.join(homeDir, '.natureco', 'skills');
|
|
741
|
+
if (fs.existsSync(skillsDir)) {
|
|
742
|
+
try {
|
|
743
|
+
const skills = fs.readdirSync(skillsDir).filter(f => {
|
|
744
|
+
const skillPath = path.join(skillsDir, f);
|
|
745
|
+
return fs.statSync(skillPath).isDirectory();
|
|
746
|
+
});
|
|
747
|
+
|
|
748
|
+
if (skills.length > 0) {
|
|
749
|
+
systemPrompt += `\n\nAVAILABLE SKILLS:`;
|
|
750
|
+
systemPrompt += `\nYou have ${skills.length} custom skills installed in ~/.natureco/skills/`;
|
|
751
|
+
systemPrompt += `\nSkills: ${skills.join(', ')}`;
|
|
752
|
+
systemPrompt += `\nThese skills may contain specialized scripts, tools, or workflows the user has configured.`;
|
|
753
|
+
}
|
|
754
|
+
} catch (err) {
|
|
755
|
+
// Silently skip if skills directory can't be read
|
|
756
|
+
}
|
|
757
|
+
}
|
|
758
|
+
|
|
739
759
|
return sendMessageToProvider(apiKey, message, conversationId, systemPrompt);
|
|
740
760
|
}
|
|
741
761
|
|