natureco-cli 1.0.50 → 1.0.51
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/bin/natureco.js +3 -2
- package/package.json +1 -1
- package/src/commands/chat.js +18 -6
- package/src/commands/dashboard.js +2 -2
package/bin/natureco.js
CHANGED
|
@@ -45,10 +45,11 @@ program
|
|
|
45
45
|
.action(bots);
|
|
46
46
|
|
|
47
47
|
program
|
|
48
|
-
.command('chat [bot-name]')
|
|
48
|
+
.command('chat [bot-name...]')
|
|
49
49
|
.description('Start interactive chat with a bot (uses default bot if not specified)')
|
|
50
50
|
.option('--resume [session-id]', 'Resume a previous session')
|
|
51
|
-
.action((
|
|
51
|
+
.action((botNameParts, options) => {
|
|
52
|
+
const botName = Array.isArray(botNameParts) ? botNameParts.join(' ') : botNameParts;
|
|
52
53
|
chat(botName, options);
|
|
53
54
|
});
|
|
54
55
|
|
package/package.json
CHANGED
package/src/commands/chat.js
CHANGED
|
@@ -35,7 +35,7 @@ async function chat(botName, options = {}) {
|
|
|
35
35
|
process.exit(1);
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
// Bot adı verilmediyse config'den defaultBot'u kullan
|
|
38
|
+
// Bot adı verilmediyse config'den defaultBot'u kullan veya interaktif seçim sun
|
|
39
39
|
let bot;
|
|
40
40
|
if (!botName) {
|
|
41
41
|
const { getConfig } = require('../utils/config');
|
|
@@ -49,12 +49,24 @@ async function chat(botName, options = {}) {
|
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
if (!bot) {
|
|
52
|
-
|
|
53
|
-
console.log(chalk.
|
|
54
|
-
botList.bots.forEach(b =>
|
|
52
|
+
// Interaktif bot seçimi
|
|
53
|
+
console.log(chalk.yellow('Varsayılan bot bulunamadı. Lütfen bir bot seçin:\n'));
|
|
54
|
+
botList.bots.forEach((b, i) => {
|
|
55
|
+
console.log(chalk.cyan(` ${i + 1}. ${b.name}`));
|
|
56
|
+
});
|
|
55
57
|
console.log('');
|
|
56
|
-
|
|
57
|
-
process.
|
|
58
|
+
|
|
59
|
+
process.stdin.resume();
|
|
60
|
+
const { selectedBot } = await inquirer.prompt([
|
|
61
|
+
{
|
|
62
|
+
type: 'list',
|
|
63
|
+
name: 'selectedBot',
|
|
64
|
+
message: 'Bot seçin:',
|
|
65
|
+
choices: botList.bots.map((b, i) => ({ name: b.name, value: b.id })),
|
|
66
|
+
},
|
|
67
|
+
]);
|
|
68
|
+
|
|
69
|
+
bot = botList.bots.find(b => b.id === selectedBot);
|
|
58
70
|
}
|
|
59
71
|
} else {
|
|
60
72
|
// Bot adı ile eşleşen botu bul
|
|
@@ -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">v1.0.
|
|
214
|
+
<div class="version-badge" id="version-badge">v1.0.51</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: 'v1.0.
|
|
344
|
+
version: 'v1.0.51',
|
|
345
345
|
bots: cfg.bots || [],
|
|
346
346
|
telegramToken: cfg.telegramToken || null,
|
|
347
347
|
whatsappConnected: cfg.whatsappConnected || false,
|