natureco-cli 2.23.30 → 2.23.32

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.
Files changed (69) hide show
  1. package/bin/natureco.js +178 -167
  2. package/package.json +1 -1
  3. package/src/commands/acp.js +39 -0
  4. package/src/commands/admin-rpc.js +83 -0
  5. package/src/commands/agent.js +214 -23
  6. package/src/commands/agents.js +114 -30
  7. package/src/commands/approvals.js +172 -11
  8. package/src/commands/ask.js +1 -1
  9. package/src/commands/browser.js +815 -0
  10. package/src/commands/capability.js +195 -22
  11. package/src/commands/channels.js +422 -267
  12. package/src/commands/chat.js +5 -8
  13. package/src/commands/clawbot.js +19 -0
  14. package/src/commands/code.js +3 -2
  15. package/src/commands/commitments.js +125 -9
  16. package/src/commands/completion.js +40 -32
  17. package/src/commands/config.js +228 -30
  18. package/src/commands/configure.js +84 -67
  19. package/src/commands/cron.js +239 -19
  20. package/src/commands/daemon.js +34 -4
  21. package/src/commands/dashboard.js +47 -374
  22. package/src/commands/devices.js +53 -26
  23. package/src/commands/directory.js +146 -14
  24. package/src/commands/dns.js +148 -10
  25. package/src/commands/docs.js +119 -26
  26. package/src/commands/doctor.js +143 -492
  27. package/src/commands/exec-policy.js +57 -48
  28. package/src/commands/gateway.js +492 -249
  29. package/src/commands/health.js +141 -11
  30. package/src/commands/help.js +24 -25
  31. package/src/commands/hooks.js +141 -87
  32. package/src/commands/infer.js +1442 -41
  33. package/src/commands/logs.js +122 -99
  34. package/src/commands/mcp.js +121 -309
  35. package/src/commands/memory.js +128 -0
  36. package/src/commands/message.js +720 -140
  37. package/src/commands/models.js +39 -1
  38. package/src/commands/node.js +77 -77
  39. package/src/commands/nodes.js +278 -22
  40. package/src/commands/onboard.js +115 -56
  41. package/src/commands/pairing.js +108 -107
  42. package/src/commands/path.js +206 -0
  43. package/src/commands/plugins.js +35 -1
  44. package/src/commands/proxy.js +159 -8
  45. package/src/commands/qr.js +55 -13
  46. package/src/commands/reset.js +101 -94
  47. package/src/commands/secrets.js +104 -21
  48. package/src/commands/sessions.js +110 -51
  49. package/src/commands/setup.js +229 -649
  50. package/src/commands/skills.js +67 -1
  51. package/src/commands/status.js +101 -127
  52. package/src/commands/tasks.js +208 -100
  53. package/src/commands/terminal.js +130 -12
  54. package/src/commands/transcripts.js +24 -1
  55. package/src/commands/tui.js +41 -0
  56. package/src/commands/uninstall.js +73 -92
  57. package/src/commands/update.js +146 -91
  58. package/src/commands/web-fetch.js +34 -0
  59. package/src/commands/webhooks.js +58 -66
  60. package/src/commands/wiki.js +783 -0
  61. package/src/utils/agents-md.js +85 -0
  62. package/src/utils/api.js +40 -41
  63. package/src/utils/format.js +144 -0
  64. package/src/utils/headless.js +2 -1
  65. package/src/utils/parallel-tools.js +106 -0
  66. package/src/utils/sub-agent.js +148 -0
  67. package/src/utils/token-budget.js +304 -0
  68. package/src/utils/tool-runner.js +7 -5
  69. package/src/utils/web-fetch.js +107 -0
@@ -1,4 +1,7 @@
1
1
  const chalk = require('chalk');
2
+ const path = require('path');
3
+ const fs = require('fs');
4
+ const os = require('os');
2
5
  const inquirer = require('../utils/inquirer-wrapper');
3
6
  const { getSkills, installSkill, removeSkill, updateAllSkills, createSkillTemplate, getPopularSkills } = require('../utils/skills');
4
7
  const { NatureCoError, SkillError, handleError } = require('../utils/errors');
@@ -63,8 +66,19 @@ async function skills(args) {
63
66
  return;
64
67
  }
65
68
 
69
+ if (action === 'info') {
70
+ const slug = params[0];
71
+ await infoSkill(slug);
72
+ return;
73
+ }
74
+
75
+ if (action === 'check') {
76
+ await checkSkills();
77
+ return;
78
+ }
79
+
66
80
  console.log(chalk.red(`\n❌ Geçersiz action: ${action}\n`));
67
- console.log(chalk.gray('Kullanım: natureco skills [list|install|remove|update|create|search|browse]\n'));
81
+ console.log(chalk.gray('Kullanım: natureco skills [list|install|remove|update|create|search|browse|info|check]\n'));
68
82
  process.exit(1);
69
83
  }
70
84
 
@@ -264,4 +278,56 @@ async function browseSkillsCommand() {
264
278
  console.log(chalk.green('\n✅ Kurulum tamamlandı!\n'));
265
279
  }
266
280
 
281
+ async function infoSkill(slug) {
282
+ if (!slug) {
283
+ console.log(chalk.red('\n ❌ Skill slug required\n'));
284
+ console.log(chalk.gray(' Usage: natureco skills info <slug>\n'));
285
+ process.exit(1);
286
+ }
287
+ const skills = getSkills();
288
+ const skill = skills.find(s => s.name === slug || s.slug === slug);
289
+ if (!skill) {
290
+ console.log(chalk.red(`\n ❌ Skill not found: ${slug}\n`));
291
+ process.exit(1);
292
+ }
293
+ console.log(chalk.gray(' ' + '─'.repeat(48)));
294
+ console.log(chalk.cyan.bold(`\n ${skill.name}\n`));
295
+ console.log(chalk.gray(' Slug : ') + chalk.white(skill.slug || skill.name));
296
+ console.log(chalk.gray(' Description : ') + chalk.white(skill.description));
297
+ if (skill.source) console.log(chalk.gray(' Source : ') + chalk.white(skill.source));
298
+ if (skill.version) console.log(chalk.gray(' Version : ') + chalk.white(skill.version));
299
+ if (skill.path) console.log(chalk.gray(' Path : ') + chalk.gray(skill.path));
300
+ if (skill.metadata?.requires?.bins) {
301
+ console.log(chalk.gray(' Requires : ') + chalk.white(skill.metadata.requires.bins.join(', ')));
302
+ }
303
+ if (skill.metadata?.requires?.env) {
304
+ console.log(chalk.gray(' Env vars : ') + chalk.white(Object.keys(skill.metadata.requires.env).join(', ')));
305
+ }
306
+ console.log('');
307
+ }
308
+
309
+ async function checkSkills() {
310
+ const skills = getSkills();
311
+ if (skills.length === 0) {
312
+ console.log(chalk.gray('\n No skills installed.\n'));
313
+ return;
314
+ }
315
+ let issues = 0;
316
+ for (const skill of skills) {
317
+ const skillPath = path.join(os.homedir(), '.natureco', 'skills', skill.slug || skill.name);
318
+ const hasSkillMd = fs.existsSync(path.join(skillPath, 'SKILL.md'));
319
+ const hasPackage = fs.existsSync(path.join(skillPath, 'package.json'));
320
+ const status = hasSkillMd ? chalk.green('✓') : chalk.yellow('⚠ missing SKILL.md');
321
+ console.log(` ${status} ${chalk.white(skill.name)}`);
322
+ console.log(chalk.gray(` Path: ${skillPath}`));
323
+ console.log(chalk.gray(` Package: ${hasPackage ? chalk.green('✓') : chalk.gray('none')}`));
324
+ if (!hasSkillMd) issues++;
325
+ }
326
+ if (issues > 0) {
327
+ console.log(chalk.yellow(`\n ⚠ ${issues} skills have issues\n`));
328
+ } else {
329
+ console.log(chalk.green(`\n ✓ All ${skills.length} skills healthy\n`));
330
+ }
331
+ }
332
+
267
333
  module.exports = skills;
@@ -1,127 +1,101 @@
1
- const chalk = require('chalk');
2
- const fs = require('fs');
3
- const path = require('path');
4
- const os = require('os');
5
- const { getConfig } = require('../utils/config');
6
- const { getSkills } = require('../utils/skills');
7
-
8
- async function status() {
9
- const config = getConfig();
10
- const version = require('../../package.json').version;
11
- const w = process.stdout.columns || 120;
12
- const line = chalk.gray('─'.repeat(w));
13
-
14
- // ── Header ────────────────────────────────────────────────────────────────
15
- console.log('');
16
- console.log(line);
17
- const title = chalk.bold.cyan(' NatureCo CLI') + chalk.gray(' — Durum Raporu');
18
- const ver = chalk.gray(`v${version} `);
19
- const pad = w - 16 - version.length - 3;
20
- console.log(title + ' '.repeat(Math.max(1, pad)) + ver);
21
- console.log(line);
22
-
23
- // ── Provider & Bot ────────────────────────────────────────────────────────
24
- const providerHost = config.providerUrl
25
- ? config.providerUrl.replace('https://', '').split('/')[0]
26
- : null;
27
- const model = config.providerModel
28
- ? config.providerModel.split('/').pop().split('-').slice(0, 3).join('-')
29
- : 'bilinmiyor';
30
-
31
- console.log('');
32
- row('Provider ', providerHost ? chalk.white(providerHost) : chalk.yellow('yapılandırılmamış'),
33
- 'Bot ', config.botName ? chalk.cyan(config.botName) : chalk.gray(''), w);
34
- row('Model ', chalk.white(model),
35
- 'Kullanıcı', config.userName ? chalk.white(config.userName) : chalk.gray('—'), w);
36
-
37
- // ── Servisler ─────────────────────────────────────────────────────────────
38
- const pidFile = path.join(os.homedir(), '.natureco', 'gateway.pid');
39
- const dashPid = path.join(os.homedir(), '.natureco', 'dashboard.pid');
40
- const gatewayRunning = fs.existsSync(pidFile);
41
- const dashRunning = fs.existsSync(dashPid);
42
-
43
- row('Gateway ', gatewayRunning ? chalk.green('● çalışıyor') : chalk.gray('○ durdurulmuş'),
44
- 'Dashboard', dashRunning ? chalk.green('● localhost:3848') : chalk.gray('○ durdurulmuş'), w);
45
-
46
- // ── Entegrasyonlar ────────────────────────────────────────────────────────
47
- const tg = config.telegramToken ? chalk.green('● bağlı') : chalk.gray(' ');
48
- const wa = config.whatsappConnected ? chalk.green('● bağlı') : chalk.gray('○ —');
49
- const dc = config.discordToken ? chalk.green('● bağlı') : chalk.gray('○ —');
50
- const sl = config.slackToken ? chalk.green('● bağlı') : chalk.gray('○ —');
51
-
52
- console.log('');
53
- console.log(chalk.gray(' ' + '─'.repeat(w - 2)));
54
- console.log(chalk.gray(' Entegrasyonlar'));
55
- console.log('');
56
- row('Telegram ', tg, 'Discord ', dc, w);
57
- row('WhatsApp ', wa, 'Slack ', sl, w);
58
-
59
- // ── Kaynaklar ─────────────────────────────────────────────────────────────
60
- const skills = getSkills();
61
- const memDir = path.join(os.homedir(), '.natureco', 'memory');
62
- const memFiles = fs.existsSync(memDir)
63
- ? fs.readdirSync(memDir).filter(f => f.endsWith('.json')).length : 0;
64
- const sessDir = path.join(os.homedir(), '.natureco', 'sessions');
65
- let sessCount = 0;
66
- if (fs.existsSync(sessDir)) {
67
- sessCount = fs.readdirSync(sessDir).filter(f => f.endsWith('.json')).length;
68
- }
69
-
70
- console.log('');
71
- console.log(chalk.gray(' ' + '─'.repeat(w - 2)));
72
- console.log(chalk.gray(' Kaynaklar'));
73
- console.log('');
74
- row('Skills ', chalk.white(`${skills.length} yüklü`),
75
- 'Hafıza ', chalk.white(`${memFiles} bot`), w);
76
- row('Sessions ', chalk.white(`${sessCount} kayıtlı`),
77
- 'Versiyon ', chalk.white(`v${version}`), w);
78
-
79
- // ── Son Loglar ────────────────────────────────────────────────────────────
80
- const logFile = path.join(os.homedir(), '.natureco', 'gateway.log');
81
- if (fs.existsSync(logFile)) {
82
- const lines = fs.readFileSync(logFile, 'utf-8').split('\n').filter(l => l.trim());
83
- const last = lines.slice(-3);
84
- if (last.length > 0) {
85
- console.log('');
86
- console.log(chalk.gray(' ' + '─'.repeat(w - 2)));
87
- console.log(chalk.gray(' Son Aktivite'));
88
- console.log('');
89
- last.forEach(l => {
90
- const trimmed = l.slice(0, w - 4);
91
- console.log(chalk.gray(' ') + chalk.gray(trimmed));
92
- });
93
- }
94
- }
95
-
96
- // ── Footer ────────────────────────────────────────────────────────────────
97
- console.log('');
98
- console.log(line);
99
- console.log(
100
- chalk.gray(' natureco doctor') +
101
- chalk.gray(' · ') +
102
- chalk.gray('natureco chat') +
103
- chalk.gray(' · ') +
104
- chalk.gray('natureco code') +
105
- chalk.gray(' · ') +
106
- chalk.gray('natureco channels status')
107
- );
108
- console.log(line);
109
- console.log('');
110
- }
111
-
112
- // ── İki kolon satır yardımcısı ─────────────────────────────────────────────
113
- function row(label1, val1, label2, val2, w) {
114
- const col = Math.floor(w / 2);
115
- const left = chalk.gray(' ' + label1) + val1;
116
- const right = chalk.gray(label2) + val2;
117
- // ANSI kodlarını sayma — sabit padding kullan
118
- const leftPlain = (' ' + label1).length + stripAnsi(String(val1)).length;
119
- const pad = Math.max(1, col - leftPlain);
120
- console.log(left + ' '.repeat(pad) + right);
121
- }
122
-
123
- function stripAnsi(str) {
124
- return str.replace(/\x1B\[[0-9;]*m/g, '');
125
- }
126
-
127
- module.exports = status;
1
+ const chalk = require('chalk');
2
+ const F = require('../utils/format');
3
+ const fs = require('fs');
4
+ const path = require('path');
5
+ const os = require('os');
6
+
7
+ function tryRequire(mod) {
8
+ try { return require(mod); }
9
+ catch { return null; }
10
+ }
11
+
12
+ function status(args) {
13
+ const [action, ...params] = args || [];
14
+
15
+ if (!action || action === 'run') return cmdRun();
16
+ if (action === 'simple') return cmdSimple();
17
+ if (action === 'usage') return cmdUsage();
18
+
19
+ F.error(`Unknown status action: ${action}`);
20
+ F.meta('Usage: natureco status <action>');
21
+ F.meta('Actions: run, simple, usage');
22
+ process.exit(1);
23
+ }
24
+
25
+ function cmdRun() {
26
+ let version = '—';
27
+ try { version = require('../../package.json').version; } catch {}
28
+
29
+ const config = tryRequire('../utils/config');
30
+ const cfg = config ? config.getConfig() : {};
31
+
32
+ F.header('System Status');
33
+ F.kv('Version', version);
34
+ F.kv('Platform', `${process.platform} ${os.release()}`);
35
+
36
+ const pidFile = path.join(os.homedir(), '.natureco', 'gateway.pid');
37
+ const gatewayRunning = fs.existsSync(pidFile);
38
+ F.dot(gatewayRunning, 'Gateway');
39
+
40
+ if (cfg.providerUrl) {
41
+ F.kv('Provider', cfg.providerUrl);
42
+ }
43
+ if (cfg.botName) {
44
+ F.kv('Bot', cfg.botName);
45
+ }
46
+
47
+ const nodesFile = path.join(os.homedir(), '.natureco', 'nodes.json');
48
+ let nodeCount = 0;
49
+ if (fs.existsSync(nodesFile)) {
50
+ try { nodeCount = Object.keys(JSON.parse(fs.readFileSync(nodesFile, 'utf8'))).length; } catch {}
51
+ }
52
+ F.kv('Nodes', String(nodeCount));
53
+
54
+ const channels = cfg.channels || cfg.telegramToken || cfg.whatsappConnected || cfg.discordToken || cfg.slackToken;
55
+ const channelCount = [cfg.telegramToken, cfg.whatsappConnected, cfg.discordToken, cfg.slackToken].filter(Boolean).length;
56
+ F.kv('Channels', String(channelCount));
57
+ F.divider();
58
+ }
59
+
60
+ function cmdSimple() {
61
+ let version = '';
62
+ try { version = require('../../package.json').version; } catch {}
63
+
64
+ const config = tryRequire('../utils/config');
65
+ const cfg = config ? config.getConfig() : {};
66
+ const pidFile = path.join(os.homedir(), '.natureco', 'gateway.pid');
67
+ const gatewayRunning = fs.existsSync(pidFile);
68
+
69
+ F.dot(gatewayRunning, 'Gateway');
70
+
71
+ const parts = [chalk.gray(`v${version}`)];
72
+ if (cfg.providerUrl) {
73
+ const host = cfg.providerUrl.replace('https://', '').split('/')[0];
74
+ parts.push(chalk.white(host));
75
+ }
76
+
77
+ console.log(chalk.cyan.bold(' NatureCo ') + parts.join(chalk.gray(' · ')));
78
+ }
79
+
80
+ function cmdUsage() {
81
+ const config = tryRequire('../utils/config');
82
+ const cfg = config ? config.getConfig() : {};
83
+
84
+ F.header('Provider Usage');
85
+
86
+ if (cfg.providerUrl) {
87
+ const rows = [
88
+ ['Provider', cfg.providerUrl],
89
+ ['Model', cfg.providerModel || '—'],
90
+ ];
91
+ const usage = cfg.usage || {};
92
+ rows.push(['Tokens', String(usage.totalTokens || '—')]);
93
+ rows.push(['Requests', String(usage.totalRequests || '—')]);
94
+ rows.push(['Session', String(usage.sessionTokens || '—')]);
95
+ F.table(['Key', 'Value'], rows);
96
+ } else {
97
+ F.info('No provider configured.');
98
+ }
99
+ }
100
+
101
+ module.exports = status;