natureco-cli 2.13.2 → 2.13.3
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 +43 -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.3</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.3',
|
|
345
345
|
bots: cfg.bots || [],
|
|
346
346
|
telegramToken: cfg.telegramToken || null,
|
|
347
347
|
whatsappConnected: cfg.whatsappConnected || false,
|
package/src/commands/migrate.js
CHANGED
|
@@ -79,6 +79,49 @@ async function migrate(options) {
|
|
|
79
79
|
memory.facts.push(notes);
|
|
80
80
|
}
|
|
81
81
|
|
|
82
|
+
// Migrate workspace/MEMORY.md and workspace/memory/*.md files
|
|
83
|
+
const memoryMdFiles = [];
|
|
84
|
+
|
|
85
|
+
// Add MEMORY.md if exists
|
|
86
|
+
const mainMemoryPath = path.join(openclawDir, 'workspace', 'MEMORY.md');
|
|
87
|
+
if (fs.existsSync(mainMemoryPath)) {
|
|
88
|
+
memoryMdFiles.push(mainMemoryPath);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
// Add memory/*.md files if directory exists
|
|
92
|
+
const memoryDirPath = path.join(openclawDir, 'workspace', 'memory');
|
|
93
|
+
if (fs.existsSync(memoryDirPath)) {
|
|
94
|
+
const memoryFiles = fs.readdirSync(memoryDirPath)
|
|
95
|
+
.filter(f => f.endsWith('.md'))
|
|
96
|
+
.map(f => path.join(memoryDirPath, f));
|
|
97
|
+
memoryMdFiles.push(...memoryFiles);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
// Process each memory file
|
|
101
|
+
for (const file of memoryMdFiles) {
|
|
102
|
+
try {
|
|
103
|
+
const content = fs.readFileSync(file, 'utf8');
|
|
104
|
+
|
|
105
|
+
// Extract meaningful lines (skip headers, empty lines)
|
|
106
|
+
const lines = content.split('\n')
|
|
107
|
+
.filter(l => l.trim() && !l.startsWith('#'))
|
|
108
|
+
.map(l => l.replace(/^[-*•]\s*/, '').trim())
|
|
109
|
+
.filter(l => l.length > 10);
|
|
110
|
+
|
|
111
|
+
// Add first 30 lines as facts (max 200 chars each)
|
|
112
|
+
for (const line of lines.slice(0, 30)) {
|
|
113
|
+
memory.facts.push({
|
|
114
|
+
value: line.slice(0, 200),
|
|
115
|
+
score: 6,
|
|
116
|
+
updatedAt: new Date().toISOString().split('T')[0]
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
} catch (err) {
|
|
120
|
+
// Skip file if error
|
|
121
|
+
console.log(chalk.gray(`⚠️ ${path.basename(file)} okunamadı`));
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
82
125
|
// Save to NatureCo memory
|
|
83
126
|
const memoryDir = path.join(os.homedir(), '.natureco', 'memory');
|
|
84
127
|
fs.mkdirSync(memoryDir, { recursive: true });
|