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.
- package/bin/natureco.js +178 -167
- package/package.json +1 -1
- package/src/commands/acp.js +39 -0
- package/src/commands/admin-rpc.js +83 -0
- package/src/commands/agent.js +214 -23
- package/src/commands/agents.js +114 -30
- package/src/commands/approvals.js +172 -11
- package/src/commands/ask.js +1 -1
- package/src/commands/browser.js +815 -0
- package/src/commands/capability.js +195 -22
- package/src/commands/channels.js +422 -267
- package/src/commands/chat.js +5 -8
- package/src/commands/clawbot.js +19 -0
- package/src/commands/code.js +3 -2
- package/src/commands/commitments.js +125 -9
- package/src/commands/completion.js +40 -32
- package/src/commands/config.js +228 -30
- package/src/commands/configure.js +84 -67
- package/src/commands/cron.js +239 -19
- package/src/commands/daemon.js +34 -4
- package/src/commands/dashboard.js +47 -374
- package/src/commands/devices.js +53 -26
- package/src/commands/directory.js +146 -14
- package/src/commands/dns.js +148 -10
- package/src/commands/docs.js +119 -26
- package/src/commands/doctor.js +143 -492
- package/src/commands/exec-policy.js +57 -48
- package/src/commands/gateway.js +492 -249
- package/src/commands/health.js +141 -11
- package/src/commands/help.js +24 -25
- package/src/commands/hooks.js +141 -87
- package/src/commands/infer.js +1442 -41
- package/src/commands/logs.js +122 -99
- package/src/commands/mcp.js +121 -309
- package/src/commands/memory.js +128 -0
- package/src/commands/message.js +720 -140
- package/src/commands/models.js +39 -1
- package/src/commands/node.js +77 -77
- package/src/commands/nodes.js +278 -22
- package/src/commands/onboard.js +115 -56
- package/src/commands/pairing.js +108 -107
- package/src/commands/path.js +206 -0
- package/src/commands/plugins.js +35 -1
- package/src/commands/proxy.js +159 -8
- package/src/commands/qr.js +55 -13
- package/src/commands/reset.js +101 -94
- package/src/commands/secrets.js +104 -21
- package/src/commands/sessions.js +110 -51
- package/src/commands/setup.js +229 -649
- package/src/commands/skills.js +67 -1
- package/src/commands/status.js +101 -127
- package/src/commands/tasks.js +208 -100
- package/src/commands/terminal.js +130 -12
- package/src/commands/transcripts.js +24 -1
- package/src/commands/tui.js +41 -0
- package/src/commands/uninstall.js +73 -92
- package/src/commands/update.js +146 -91
- package/src/commands/web-fetch.js +34 -0
- package/src/commands/webhooks.js +58 -66
- package/src/commands/wiki.js +783 -0
- package/src/utils/agents-md.js +85 -0
- package/src/utils/api.js +40 -41
- package/src/utils/format.js +144 -0
- package/src/utils/headless.js +2 -1
- package/src/utils/parallel-tools.js +106 -0
- package/src/utils/sub-agent.js +148 -0
- package/src/utils/token-budget.js +304 -0
- package/src/utils/tool-runner.js +7 -5
- package/src/utils/web-fetch.js +107 -0
package/src/commands/skills.js
CHANGED
|
@@ -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;
|
package/src/commands/status.js
CHANGED
|
@@ -1,127 +1,101 @@
|
|
|
1
|
-
const chalk = require('chalk');
|
|
2
|
-
const
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
const
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
const
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
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;
|