natureco-cli 4.6.6 → 4.6.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 +1 -1
- package/src/commands/agents.js +27 -11
- package/src/commands/approvals.js +41 -19
- package/src/commands/channels.js +27 -20
- package/src/commands/devices.js +19 -9
- package/src/commands/secrets.js +13 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "natureco-cli",
|
|
3
|
-
"version": "4.6.
|
|
3
|
+
"version": "4.6.8",
|
|
4
4
|
"description": "OpenClaw'dan daha güvenli, daha hızlı, daha ucuz AI agent CLI. Multi-agent, self-evolving skills, audit log, maliyet optimizasyonu ve NatureCo platform-native.",
|
|
5
5
|
"bin": {
|
|
6
6
|
"natureco": "bin/natureco.js"
|
package/src/commands/agents.js
CHANGED
|
@@ -62,22 +62,38 @@ async function listAgents() {
|
|
|
62
62
|
botList = await getBots(apiKey);
|
|
63
63
|
} catch {}
|
|
64
64
|
|
|
65
|
-
|
|
65
|
+
console.log('\n' + tui.styled(' 🤖 Agents', { color: tui.PALETTE.primary, bold: true }));
|
|
66
|
+
console.log(tui.styled(' ' + '─'.repeat(56), { color: tui.PALETTE.border }));
|
|
66
67
|
|
|
67
68
|
if (!botList.bots?.length) {
|
|
68
|
-
|
|
69
|
+
console.log('\n ' + tui.C.muted('Agent bulunamadı.'));
|
|
70
|
+
console.log(' ' + tui.C.muted('Oluşturmak için: ') + tui.C.brand('developers.natureco.me'));
|
|
71
|
+
console.log('');
|
|
69
72
|
return;
|
|
70
73
|
}
|
|
71
74
|
|
|
72
|
-
const rows = botList.bots.map(bot =>
|
|
73
|
-
bot.name + (config.botName === bot.name ? '
|
|
74
|
-
bot.id,
|
|
75
|
-
bot.ai_provider || 'groq',
|
|
76
|
-
bot.model || '—'
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
console.log(
|
|
75
|
+
const rows = botList.bots.map(bot => ({
|
|
76
|
+
name: bot.name + (config.botName === bot.name ? ' ●' : ''),
|
|
77
|
+
id: bot.id,
|
|
78
|
+
provider: bot.ai_provider || 'groq',
|
|
79
|
+
model: bot.model || '—',
|
|
80
|
+
active: config.botName === bot.name,
|
|
81
|
+
}));
|
|
82
|
+
|
|
83
|
+
console.log('\n' + tui.table(rows, [
|
|
84
|
+
{
|
|
85
|
+
key: 'name', label: 'İsim', minWidth: 18,
|
|
86
|
+
render: r => r.active
|
|
87
|
+
? tui.styled(r.name, { color: tui.PALETTE.success, bold: true })
|
|
88
|
+
: tui.C.text(r.name)
|
|
89
|
+
},
|
|
90
|
+
{ key: 'id', label: 'ID', minWidth: 16, render: r => tui.C.muted(r.id) },
|
|
91
|
+
{ key: 'provider', label: 'Provider', minWidth: 12, render: r => tui.C.text(r.provider) },
|
|
92
|
+
{ key: 'model', label: 'Model', minWidth: 18, render: r => tui.C.muted(r.model) },
|
|
93
|
+
], { borderStyle: 'round', zebra: true }));
|
|
94
|
+
|
|
95
|
+
console.log('\n ' + tui.C.muted('Değiştirmek için: ') + tui.C.brand('natureco agents set <bot-adı>'));
|
|
96
|
+
console.log('');
|
|
81
97
|
}
|
|
82
98
|
|
|
83
99
|
async function setActiveAgent(botName) {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
const chalk = require('chalk');
|
|
2
|
+
const tui = require('../utils/tui');
|
|
2
3
|
const F = require('../utils/format');
|
|
3
4
|
const fs = require('fs');
|
|
4
5
|
const path = require('path');
|
|
@@ -59,33 +60,54 @@ function listApprovals() {
|
|
|
59
60
|
const policy = config.execApprovalPolicy || 'auto';
|
|
60
61
|
const queue = loadQueue();
|
|
61
62
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
const
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
63
|
+
console.log('\n' + tui.styled(' 🛡️ Approvals', { color: tui.PALETTE.primary, bold: true }));
|
|
64
|
+
console.log(tui.styled(' ' + '─'.repeat(56), { color: tui.PALETTE.border }));
|
|
65
|
+
|
|
66
|
+
// Mini info card
|
|
67
|
+
const cardW = 48;
|
|
68
|
+
const pendingCount = queue.filter(r => r.status === 'pending').length;
|
|
69
|
+
console.log(tui.styled(' ╭' + '─'.repeat(cardW) + '╮', { color: tui.PALETTE.border }));
|
|
70
|
+
console.log(tui.styled(' │ ', { color: tui.PALETTE.border }) + tui.C.muted('Policy ') + tui.styled(policy.padEnd(40), { color: tui.PALETTE.text, bold: true }) + tui.styled(' │', { color: tui.PALETTE.border }));
|
|
71
|
+
console.log(tui.styled(' │ ', { color: tui.PALETTE.border }) + tui.C.muted('Queue ') + tui.styled((pendingCount + ' pending').padEnd(40), { color: pendingCount > 0 ? tui.PALETTE.warning : tui.PALETTE.success, bold: true }) + tui.styled(' │', { color: tui.PALETTE.border }));
|
|
72
|
+
console.log(tui.styled(' ╰' + '─'.repeat(cardW) + '╯', { color: tui.PALETTE.border }));
|
|
73
|
+
|
|
74
|
+
const rows = queue.map(r => ({
|
|
75
|
+
id: r.id, source: r.source || 'cli', text: r.text, status: r.status,
|
|
76
|
+
}));
|
|
77
|
+
|
|
78
|
+
console.log('\n' + tui.table(rows, [
|
|
79
|
+
{ key: 'id', label: 'ID', minWidth: 14, render: r => tui.C.muted(r.id) },
|
|
80
|
+
{ key: 'source', label: 'Kaynak', minWidth: 12, render: r => tui.C.text(r.source) },
|
|
81
|
+
{ key: 'text', label: 'Komut', minWidth: 25, render: r => tui.C.muted(r.text) },
|
|
82
|
+
{
|
|
83
|
+
key: 'status', label: 'Durum', minWidth: 12,
|
|
84
|
+
render: r => r.status === 'pending'
|
|
85
|
+
? tui.styled(' ⏳ Bekliyor ', { bg: tui.PALETTE.warning, color: '#000', bold: true })
|
|
86
|
+
: r.status === 'approved'
|
|
87
|
+
? tui.styled(' ✓ Onaylı ', { bg: tui.PALETTE.success, color: '#000', bold: true })
|
|
88
|
+
: tui.styled(' ✗ Reddedildi ', { bg: tui.PALETTE.danger, color: '#000', bold: true })
|
|
89
|
+
},
|
|
90
|
+
], { borderStyle: 'round', zebra: true }));
|
|
91
|
+
console.log('');
|
|
73
92
|
}
|
|
74
93
|
|
|
75
94
|
function listPending() {
|
|
76
95
|
const queue = loadQueue().filter(r => r.status === 'pending');
|
|
77
96
|
if (queue.length === 0) {
|
|
78
|
-
|
|
97
|
+
console.log('\n' + tui.C.muted(' No pending approvals.') + '\n');
|
|
79
98
|
return;
|
|
80
99
|
}
|
|
81
100
|
|
|
82
|
-
const rows = queue.map(r =>
|
|
83
|
-
r.id,
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
101
|
+
const rows = queue.map(r => ({
|
|
102
|
+
id: r.id, source: r.source || 'cli', text: r.text, status: r.status,
|
|
103
|
+
}));
|
|
104
|
+
console.log('\n' + tui.styled(' ⏳ Bekleyen Onaylar (' + rows.length + ')', { color: tui.PALETTE.warning, bold: true }));
|
|
105
|
+
console.log('\n' + tui.table(rows, [
|
|
106
|
+
{ key: 'id', label: 'ID', minWidth: 14, render: r => tui.C.muted(r.id) },
|
|
107
|
+
{ key: 'source', label: 'Kaynak', minWidth: 12, render: r => tui.C.text(r.source) },
|
|
108
|
+
{ key: 'text', label: 'Komut', minWidth: 25, render: r => tui.C.muted(r.text) },
|
|
109
|
+
], { borderStyle: 'round', zebra: true }));
|
|
110
|
+
console.log('');
|
|
89
111
|
}
|
|
90
112
|
|
|
91
113
|
function addReq(text) {
|
package/src/commands/channels.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
const chalk = require('chalk');
|
|
2
|
+
const tui = require('../utils/tui');
|
|
2
3
|
const F = require('../utils/format');
|
|
3
4
|
const { getConfig, saveConfig } = require('../utils/config');
|
|
4
5
|
const fs = require('fs');
|
|
@@ -296,29 +297,35 @@ function listChannels() {
|
|
|
296
297
|
F.header('Channels');
|
|
297
298
|
|
|
298
299
|
if (channels.length === 0) {
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
'natureco
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
'natureco irc connect',
|
|
308
|
-
'natureco mattermost connect',
|
|
309
|
-
'natureco imessage connect',
|
|
310
|
-
'natureco sms connect',
|
|
311
|
-
'natureco webhooks connect',
|
|
312
|
-
]);
|
|
300
|
+
console.log('\n' + tui.styled(' 📡 Bağlı Kanal Yok', { color: tui.PALETTE.warning, bold: true }));
|
|
301
|
+
console.log(tui.styled(' ' + '─'.repeat(56), { color: tui.PALETTE.border }));
|
|
302
|
+
console.log('\n ' + tui.C.muted('Bağlamak için:'));
|
|
303
|
+
const connectCmds = ['telegram', 'whatsapp', 'discord', 'slack', 'signal', 'irc', 'mattermost', 'imessage', 'sms', 'webhooks'];
|
|
304
|
+
for (const c of connectCmds) {
|
|
305
|
+
console.log(' ' + tui.C.brand('natureco ' + c + ' connect'));
|
|
306
|
+
}
|
|
307
|
+
console.log('');
|
|
313
308
|
return;
|
|
314
309
|
}
|
|
315
310
|
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
311
|
+
console.log('\n' + tui.styled(' 📡 Bağlı Kanallar (' + channels.length + ')', { color: tui.PALETTE.primary, bold: true }));
|
|
312
|
+
console.log(tui.styled(' ' + '─'.repeat(56), { color: tui.PALETTE.border }));
|
|
313
|
+
console.log('\n' + tui.table(channels, [
|
|
314
|
+
{
|
|
315
|
+
key: 'name', label: 'Kanal', minWidth: 14,
|
|
316
|
+
render: r => tui.styled(r.type + ' ' + r.name, { color: tui.PALETTE.primary, bold: true })
|
|
317
|
+
},
|
|
318
|
+
{
|
|
319
|
+
key: 'status', label: 'Durum', minWidth: 14,
|
|
320
|
+
render: r => r.status === 'connected'
|
|
321
|
+
? tui.styled(' ✓ Bağlı ', { bg: tui.PALETTE.success, color: '#000', bold: true })
|
|
322
|
+
: tui.styled(' ✗ Kopuk ', { bg: tui.PALETTE.muted, color: '#000', bold: true })
|
|
323
|
+
},
|
|
324
|
+
{ key: 'detail', label: 'Detay', minWidth: 30, render: r => tui.C.muted(r.detail) },
|
|
325
|
+
], { borderStyle: 'round', zebra: true }));
|
|
326
|
+
|
|
327
|
+
console.log('\n ' + tui.C.muted('Kaldırmak için: ') + tui.C.brand('natureco channels remove <kanal>'));
|
|
328
|
+
console.log('');
|
|
322
329
|
}
|
|
323
330
|
|
|
324
331
|
function statusChannels() {
|
package/src/commands/devices.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
const chalk = require('chalk');
|
|
2
|
+
const tui = require('../utils/tui');
|
|
2
3
|
const F = require('../utils/format');
|
|
3
4
|
const { getConfig, saveConfig } = require('../utils/config');
|
|
4
5
|
const fs = require('fs');
|
|
@@ -27,20 +28,29 @@ function listDevices() {
|
|
|
27
28
|
const config = getConfig();
|
|
28
29
|
const devices = config.pairedDevices || [];
|
|
29
30
|
|
|
30
|
-
|
|
31
|
+
console.log('\n' + tui.styled(' 📱 Cihaz Listesi', { color: tui.PALETTE.primary, bold: true }));
|
|
32
|
+
console.log(tui.styled(' ' + '─'.repeat(56), { color: tui.PALETTE.border }));
|
|
31
33
|
|
|
32
34
|
if (devices.length === 0) {
|
|
33
|
-
|
|
35
|
+
console.log('\n ' + tui.C.muted('Eşleşmiş cihaz yok.'));
|
|
36
|
+
console.log(' ' + tui.C.muted('Eşleştirmek için: ') + tui.C.brand('natureco devices pair <ad> <tip>'));
|
|
37
|
+
console.log('');
|
|
34
38
|
return;
|
|
35
39
|
}
|
|
36
40
|
|
|
37
|
-
const rows = devices.map(d =>
|
|
38
|
-
d.id,
|
|
39
|
-
d.
|
|
40
|
-
d.
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
41
|
+
const rows = devices.map(d => ({
|
|
42
|
+
id: d.id, name: d.name,
|
|
43
|
+
type: d.type || 'unknown',
|
|
44
|
+
lastSeen: d.pairedAt ? new Date(d.pairedAt).toLocaleString() : '-',
|
|
45
|
+
}));
|
|
46
|
+
|
|
47
|
+
console.log('\n' + tui.table(rows, [
|
|
48
|
+
{ key: 'id', label: 'ID', minWidth: 16, render: r => tui.C.muted(r.id) },
|
|
49
|
+
{ key: 'name', label: 'İsim', minWidth: 14, render: r => tui.styled(r.name, { color: tui.PALETTE.primary, bold: true }) },
|
|
50
|
+
{ key: 'type', label: 'Tip', minWidth: 12, render: r => tui.C.text(r.type) },
|
|
51
|
+
{ key: 'lastSeen', label: 'Eşleşme', minWidth: 18, render: r => tui.C.muted(r.lastSeen) },
|
|
52
|
+
], { borderStyle: 'round', zebra: true }));
|
|
53
|
+
console.log('');
|
|
44
54
|
}
|
|
45
55
|
|
|
46
56
|
function pairDevice(name, type) {
|
package/src/commands/secrets.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
const chalk = require('chalk');
|
|
2
|
+
const tui = require('../utils/tui');
|
|
2
3
|
const F = require('../utils/format');
|
|
3
4
|
const { getConfig, saveConfig } = require('../utils/config');
|
|
4
5
|
|
|
@@ -25,19 +26,27 @@ function listSecrets() {
|
|
|
25
26
|
k.toLowerCase().includes('key') || k.toLowerCase().includes('token') || k.toLowerCase().includes('secret')
|
|
26
27
|
);
|
|
27
28
|
|
|
28
|
-
|
|
29
|
+
console.log('\n' + tui.styled(' 🔐 Secrets', { color: tui.PALETTE.primary, bold: true }));
|
|
30
|
+
console.log(tui.styled(' ' + '─'.repeat(56), { color: tui.PALETTE.border }));
|
|
29
31
|
|
|
30
32
|
if (secretKeys.length === 0) {
|
|
31
|
-
|
|
33
|
+
console.log('\n ' + tui.C.muted('No secrets stored.'));
|
|
34
|
+
console.log('');
|
|
32
35
|
return;
|
|
33
36
|
}
|
|
34
37
|
|
|
35
38
|
const rows = secretKeys.sort().map(key => {
|
|
36
39
|
const val = config[key];
|
|
37
40
|
const masked = val ? val.substring(0, 6) + '…' + val.slice(-4) : '(empty)';
|
|
38
|
-
return
|
|
41
|
+
return { key, masked, updated: '-' };
|
|
39
42
|
});
|
|
40
|
-
|
|
43
|
+
|
|
44
|
+
console.log('\n' + tui.table(rows, [
|
|
45
|
+
{ key: 'key', label: 'İsim', minWidth: 24, render: r => tui.styled(r.key, { color: tui.PALETTE.primary, bold: true }) },
|
|
46
|
+
{ key: 'masked', label: 'Maskelenmiş', minWidth: 16, render: r => tui.styled(r.masked, { color: tui.PALETTE.warning }) },
|
|
47
|
+
{ key: 'updated', label: 'Güncellendi', minWidth: 14, render: r => tui.C.muted(r.updated) },
|
|
48
|
+
], { borderStyle: 'round', zebra: true }));
|
|
49
|
+
console.log('');
|
|
41
50
|
}
|
|
42
51
|
|
|
43
52
|
function setSecret(key, value) {
|