natureco-cli 2.23.29 → 2.23.31
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/README.md +94 -11
- package/bin/natureco.js +495 -94
- package/package.json +1 -1
- package/src/commands/acp.js +39 -0
- package/src/commands/admin-rpc.js +302 -0
- package/src/commands/agent.js +280 -0
- package/src/commands/agents.js +114 -30
- package/src/commands/approvals.js +214 -0
- package/src/commands/backup.js +124 -0
- package/src/commands/bonjour.js +167 -0
- package/src/commands/browser.js +815 -0
- package/src/commands/capability.js +237 -0
- package/src/commands/channels.js +422 -267
- package/src/commands/chat.js +5 -8
- package/src/commands/clawbot.js +19 -0
- package/src/commands/clickclack.js +130 -0
- package/src/commands/code.js +3 -2
- package/src/commands/commitments.js +148 -0
- package/src/commands/completion.js +84 -0
- package/src/commands/config.js +219 -30
- package/src/commands/configure.js +110 -0
- package/src/commands/crestodian.js +92 -0
- package/src/commands/cron.js +239 -19
- package/src/commands/daemon.js +90 -0
- package/src/commands/dashboard.js +47 -374
- package/src/commands/device-pair.js +248 -0
- package/src/commands/devices.js +137 -0
- package/src/commands/directory.js +179 -0
- package/src/commands/dns.js +196 -0
- package/src/commands/docs.js +136 -0
- package/src/commands/doctor.js +143 -492
- package/src/commands/exec-policy.js +80 -0
- package/src/commands/gateway-server.js +1155 -24
- package/src/commands/gateway.js +492 -249
- package/src/commands/health.js +148 -0
- package/src/commands/help.js +24 -25
- package/src/commands/hooks.js +141 -87
- package/src/commands/imessage.js +128 -14
- package/src/commands/infer.js +1474 -0
- package/src/commands/irc.js +64 -15
- package/src/commands/logs.js +122 -99
- package/src/commands/mattermost.js +114 -12
- package/src/commands/mcp.js +121 -309
- package/src/commands/memory-cmd.js +134 -1
- package/src/commands/memory.js +128 -0
- package/src/commands/message.js +720 -134
- package/src/commands/migrate.js +213 -2
- package/src/commands/models.js +39 -1
- package/src/commands/node.js +98 -0
- package/src/commands/nodes.js +362 -0
- package/src/commands/oc-path.js +200 -0
- package/src/commands/onboard.js +129 -0
- package/src/commands/open-prose.js +67 -0
- package/src/commands/pairing.js +108 -107
- package/src/commands/path.js +206 -0
- package/src/commands/plugins.js +35 -1
- package/src/commands/policy.js +176 -0
- package/src/commands/proxy.js +306 -0
- package/src/commands/qr.js +70 -0
- package/src/commands/reset.js +101 -94
- package/src/commands/sandbox.js +125 -0
- package/src/commands/secrets.js +201 -0
- package/src/commands/sessions.js +110 -51
- package/src/commands/setup.js +102 -543
- package/src/commands/signal.js +447 -18
- package/src/commands/skills.js +67 -1
- package/src/commands/sms.js +123 -19
- package/src/commands/status.js +101 -127
- package/src/commands/system.js +53 -0
- package/src/commands/tasks.js +208 -100
- package/src/commands/terminal.js +139 -0
- package/src/commands/thread-ownership.js +157 -0
- package/src/commands/transcripts.js +95 -0
- package/src/commands/tui.js +41 -0
- package/src/commands/uninstall.js +73 -92
- package/src/commands/update.js +146 -91
- package/src/commands/voice.js +82 -0
- package/src/commands/vydra.js +98 -0
- package/src/commands/webhooks.js +58 -66
- package/src/commands/wiki.js +783 -0
- package/src/commands/workboard.js +207 -0
- package/src/tools/audio_understanding.js +154 -0
- package/src/tools/browser.js +112 -0
- package/src/tools/canvas.js +104 -0
- package/src/tools/document_extract.js +84 -0
- package/src/tools/duckduckgo.js +54 -0
- package/src/tools/exa_search.js +66 -0
- package/src/tools/firecrawl.js +104 -0
- package/src/tools/image_generation.js +99 -0
- package/src/tools/llm_task.js +118 -0
- package/src/tools/media_understanding.js +128 -0
- package/src/tools/music_generation.js +113 -0
- package/src/tools/parallel_search.js +77 -0
- package/src/tools/phone_control.js +80 -0
- package/src/tools/phone_control_enhanced.js +184 -0
- package/src/tools/searxng.js +61 -0
- package/src/tools/speech_to_text.js +135 -0
- package/src/tools/text_to_speech.js +105 -0
- package/src/tools/thread_ownership.js +88 -0
- package/src/tools/video_generation.js +72 -0
- package/src/tools/web_readability.js +104 -0
- package/src/utils/agents-md.js +85 -0
- package/src/utils/api.js +39 -40
- package/src/utils/format.js +144 -0
- package/src/utils/headless.js +2 -1
- package/src/utils/memory.js +200 -0
- 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
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
const chalk = require('chalk');
|
|
2
|
+
const dns = require('dns');
|
|
3
|
+
const os = require('os');
|
|
4
|
+
|
|
5
|
+
function dnsCmd(args) {
|
|
6
|
+
const [action, ...params] = args || [];
|
|
7
|
+
|
|
8
|
+
if (!action || action === 'discover') return discoverNetwork();
|
|
9
|
+
if (action === 'resolve') return resolveHost(params[0]);
|
|
10
|
+
if (action === 'services') return discoverServices();
|
|
11
|
+
|
|
12
|
+
console.log(chalk.red(`\n ❌ Bilinmeyen komut: ${action}\n`));
|
|
13
|
+
console.log(chalk.gray(' Kullanım: natureco dns [discover|resolve <host>|services]\n'));
|
|
14
|
+
process.exit(1);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function discoverNetwork() {
|
|
18
|
+
console.log(chalk.cyan('\n Network Discovery (DNS)\n'));
|
|
19
|
+
console.log(chalk.gray(' ' + '─'.repeat(48)));
|
|
20
|
+
|
|
21
|
+
const interfaces = os.networkInterfaces();
|
|
22
|
+
for (const [name, addrs] of Object.entries(interfaces)) {
|
|
23
|
+
if (!addrs) continue;
|
|
24
|
+
for (const addr of addrs) {
|
|
25
|
+
if (addr.family === 'IPv4' && !addr.internal) {
|
|
26
|
+
console.log(` ${chalk.white(name)}`);
|
|
27
|
+
console.log(` ${chalk.gray('IP:')} ${addr.address}`);
|
|
28
|
+
console.log(` ${chalk.gray('MAC:')} ${addr.mac}`);
|
|
29
|
+
console.log(` ${chalk.gray('Mask:')} ${addr.netmask}`);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const tailscaleIP = detectTailscale();
|
|
35
|
+
if (tailscaleIP) {
|
|
36
|
+
console.log(`\n ${chalk.green('●')} ${chalk.white('Tailscale')}: ${chalk.cyan(tailscaleIP)}`);
|
|
37
|
+
const hostname = os.hostname();
|
|
38
|
+
dns.resolveTxt(`_natureco._tcp.${hostname}.tailscale.net`, (err, records) => {
|
|
39
|
+
if (!err && records) {
|
|
40
|
+
console.log(` ${chalk.gray(' Service:')} ${chalk.cyan(records.flat().join(', '))}`);
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
const zerotier = detectZeroTier();
|
|
46
|
+
if (zerotier) {
|
|
47
|
+
console.log(` ${chalk.green('●')} ${chalk.white('ZeroTier')}: ${chalk.cyan(zerotier)}`);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
console.log(chalk.gray('\n mDNS: ') + chalk.cyan('natureco bonjour scan'));
|
|
51
|
+
console.log(chalk.gray(' Resolve: ') + chalk.cyan('natureco dns resolve <hostname>'));
|
|
52
|
+
console.log(chalk.gray(' Services: ') + chalk.cyan('natureco dns services\n'));
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function detectTailscale() {
|
|
56
|
+
try {
|
|
57
|
+
const tailscaleDir = os.platform() === 'win32'
|
|
58
|
+
? os.homedir() + '\\AppData\\Local\\Tailscale'
|
|
59
|
+
: '/var/run/tailscale';
|
|
60
|
+
if (!require('fs').existsSync(tailscaleDir)) return null;
|
|
61
|
+
|
|
62
|
+
const interfaces = os.networkInterfaces();
|
|
63
|
+
for (const [, addrs] of Object.entries(interfaces)) {
|
|
64
|
+
if (!addrs) continue;
|
|
65
|
+
for (const addr of addrs) {
|
|
66
|
+
if (addr.family === 'IPv4' && addr.address.startsWith('100.')) {
|
|
67
|
+
return addr.address;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
} catch {}
|
|
72
|
+
return null;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
function detectZeroTier() {
|
|
76
|
+
try {
|
|
77
|
+
const interfaces = os.networkInterfaces();
|
|
78
|
+
for (const [, addrs] of Object.entries(interfaces)) {
|
|
79
|
+
if (!addrs) continue;
|
|
80
|
+
for (const addr of addrs) {
|
|
81
|
+
if (addr.family === 'IPv4' && (
|
|
82
|
+
addr.address.startsWith('10.144.') ||
|
|
83
|
+
addr.address.startsWith('10.147.')
|
|
84
|
+
)) {
|
|
85
|
+
return addr.address;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
} catch {}
|
|
90
|
+
return null;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
function resolveHost(hostname) {
|
|
94
|
+
if (!hostname) {
|
|
95
|
+
console.log(chalk.red('\n ❌ Hostname gerekli\n'));
|
|
96
|
+
console.log(chalk.gray(' Kullanım: natureco dns resolve <hostname>\n'));
|
|
97
|
+
process.exit(1);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
console.log(chalk.cyan(`\n Resolving: ${hostname}\n`));
|
|
101
|
+
|
|
102
|
+
dns.resolve4(hostname, (err, addresses) => {
|
|
103
|
+
if (err && err.code !== 'ENODATA') {
|
|
104
|
+
console.log(chalk.red(` ❌ ${err.message}\n`));
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
const results = [];
|
|
109
|
+
if (addresses && addresses.length > 0) {
|
|
110
|
+
for (const addr of addresses) {
|
|
111
|
+
results.push({ type: 'A', value: addr });
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
dns.resolve6(hostname, (err6, addrs6) => {
|
|
116
|
+
if (!err6 && addrs6) {
|
|
117
|
+
for (const addr of addrs6) {
|
|
118
|
+
results.push({ type: 'AAAA', value: addr });
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
dns.resolveTxt(hostname, (errTxt, txts) => {
|
|
123
|
+
if (!errTxt && txts) {
|
|
124
|
+
for (const txt of txts) {
|
|
125
|
+
results.push({ type: 'TXT', value: txt.join(' ') });
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
dns.resolveSrv(`_natureco._tcp.${hostname}`, (errSrv, srvs) => {
|
|
130
|
+
if (!errSrv && srvs) {
|
|
131
|
+
for (const srv of srvs) {
|
|
132
|
+
results.push({ type: 'SRV', value: `${srv.name}:${srv.port} (priority ${srv.priority}, weight ${srv.weight})` });
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
if (results.length === 0) {
|
|
137
|
+
console.log(chalk.gray(' No DNS records found.\n'));
|
|
138
|
+
return;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
console.log(chalk.gray(' ' + '─'.repeat(48)));
|
|
142
|
+
for (const r of results) {
|
|
143
|
+
console.log(` ${chalk.white(hostname)} ${chalk.cyan(r.type)} ${chalk.gray('→')} ${chalk.white(r.value)}`);
|
|
144
|
+
}
|
|
145
|
+
console.log();
|
|
146
|
+
});
|
|
147
|
+
});
|
|
148
|
+
});
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
function discoverServices() {
|
|
153
|
+
console.log(chalk.cyan('\n Service Discovery (DNS-SD)\n'));
|
|
154
|
+
console.log(chalk.gray(' ' + '─'.repeat(48)));
|
|
155
|
+
|
|
156
|
+
const services = [
|
|
157
|
+
'_natureco._tcp',
|
|
158
|
+
'_natureco-gateway._tcp',
|
|
159
|
+
'_natureco-dashboard._tcp',
|
|
160
|
+
'_mcp._tcp',
|
|
161
|
+
'_openclaw._tcp',
|
|
162
|
+
];
|
|
163
|
+
|
|
164
|
+
let pending = services.length;
|
|
165
|
+
let found = false;
|
|
166
|
+
|
|
167
|
+
for (const svc of services) {
|
|
168
|
+
dns.resolveSrv(svc + '.local', { hints: dns.ADDRCONFIG }, (err, addresses) => {
|
|
169
|
+
if (!err && addresses && addresses.length > 0) {
|
|
170
|
+
found = true;
|
|
171
|
+
console.log(` ${chalk.green('●')} ${chalk.white(svc)}`);
|
|
172
|
+
for (const addr of addresses) {
|
|
173
|
+
dns.resolve4(addr.name, { hints: dns.ADDRCONFIG }, (err4, ips) => {
|
|
174
|
+
const ip = ips && ips.length > 0 ? `(${ips[0]})` : '';
|
|
175
|
+
console.log(` ${chalk.gray(`${addr.name}:${addr.port} ${ip}`)}`);
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
console.log();
|
|
179
|
+
}
|
|
180
|
+
pending--;
|
|
181
|
+
if (pending === 0 && !found) {
|
|
182
|
+
console.log(chalk.gray(' No NatureCo services discovered via DNS-SD.\n'));
|
|
183
|
+
console.log(chalk.gray(' Try: ') + chalk.cyan('natureco bonjour discover'));
|
|
184
|
+
console.log(chalk.gray(' Try: ') + chalk.cyan('natureco dns discover\n'));
|
|
185
|
+
}
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
setTimeout(() => {
|
|
190
|
+
if (!found) {
|
|
191
|
+
console.log(chalk.gray(' Discovering... (may take a moment)\n'));
|
|
192
|
+
}
|
|
193
|
+
}, 500);
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
module.exports = dnsCmd;
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
const chalk = require('chalk');
|
|
2
|
+
|
|
3
|
+
const DOC_SOURCES = [
|
|
4
|
+
{ name: 'NatureCo API', url: 'https://api.natureco.me/api/v1/docs/search?q=' },
|
|
5
|
+
{ name: 'NatureCo CLI', url: 'https://natureco.me/cli/' },
|
|
6
|
+
{ name: 'NatureCo Developers', url: 'https://developers.natureco.me/' },
|
|
7
|
+
{ name: 'OpenClaw Docs', url: 'https://docs.openclaw.ai/' },
|
|
8
|
+
];
|
|
9
|
+
|
|
10
|
+
async function docs(args) {
|
|
11
|
+
const query = args.join(' ').trim();
|
|
12
|
+
|
|
13
|
+
if (!query) {
|
|
14
|
+
showHelp();
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
console.log(chalk.cyan(`\n Searching docs for: "${query}"\n`));
|
|
19
|
+
|
|
20
|
+
let found = false;
|
|
21
|
+
|
|
22
|
+
for (const source of DOC_SOURCES) {
|
|
23
|
+
try {
|
|
24
|
+
const url = source.url.includes('/docs/search')
|
|
25
|
+
? source.url + encodeURIComponent(query)
|
|
26
|
+
: source.url;
|
|
27
|
+
const response = await fetch(url + (source.url.includes('/docs/search') ? '' : '?format=json'), {
|
|
28
|
+
headers: { 'User-Agent': 'NatureCo-CLI/2.0' },
|
|
29
|
+
signal: AbortSignal.timeout(3000),
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
if (response.ok) {
|
|
33
|
+
const text = await response.text();
|
|
34
|
+
let data;
|
|
35
|
+
try { data = JSON.parse(text); } catch { data = null; }
|
|
36
|
+
|
|
37
|
+
if (data && data.results && data.results.length > 0) {
|
|
38
|
+
found = true;
|
|
39
|
+
console.log(chalk.cyan(` ${source.name}\n`));
|
|
40
|
+
console.log(chalk.gray(' ' + '─'.repeat(48)));
|
|
41
|
+
for (const r of data.results.slice(0, 5)) {
|
|
42
|
+
console.log(` ${chalk.white(r.title || r.name || 'Result')}`);
|
|
43
|
+
if (r.description) console.log(` ${chalk.gray(r.description)}`);
|
|
44
|
+
if (r.url) console.log(` ${chalk.cyan(r.url)}`);
|
|
45
|
+
console.log();
|
|
46
|
+
}
|
|
47
|
+
} else if (data && data.AbstractText) {
|
|
48
|
+
found = true;
|
|
49
|
+
console.log(chalk.cyan(` ${source.name}\n`));
|
|
50
|
+
console.log(chalk.gray(' ' + '─'.repeat(48)));
|
|
51
|
+
console.log(` ${chalk.white(data.AbstractText)}`);
|
|
52
|
+
if (data.AbstractURL) console.log(`\n ${chalk.cyan(data.AbstractURL)}`);
|
|
53
|
+
console.log();
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
} catch {}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
if (!found) {
|
|
60
|
+
try {
|
|
61
|
+
const webRes = await fetch(`https://api.duckduckgo.com/?q=${encodeURIComponent('site:natureco.me ' + query)}&format=json&no_html=1&skip_disambig=1`, {
|
|
62
|
+
headers: { 'User-Agent': 'NatureCo-CLI/2.0' },
|
|
63
|
+
signal: AbortSignal.timeout(5000),
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
if (webRes.ok) {
|
|
67
|
+
const webData = await webRes.json();
|
|
68
|
+
if (webData.AbstractText || webData.RelatedTopics?.length > 0) {
|
|
69
|
+
found = true;
|
|
70
|
+
console.log(chalk.cyan(' NatureCo (via DuckDuckGo)\n'));
|
|
71
|
+
console.log(chalk.gray(' ' + '─'.repeat(48)));
|
|
72
|
+
if (webData.AbstractText) {
|
|
73
|
+
console.log(` ${chalk.white(webData.AbstractText)}`);
|
|
74
|
+
if (webData.AbstractURL) console.log(`\n ${chalk.cyan(webData.AbstractURL)}`);
|
|
75
|
+
} else {
|
|
76
|
+
for (const topic of webData.RelatedTopics.slice(0, 5)) {
|
|
77
|
+
if (topic.Text) {
|
|
78
|
+
console.log(` ${chalk.white(topic.Text)}`);
|
|
79
|
+
if (topic.FirstURL) console.log(` ${chalk.cyan(topic.FirstURL)}`);
|
|
80
|
+
console.log();
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
console.log();
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
} catch {}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
if (!found) {
|
|
91
|
+
try {
|
|
92
|
+
const htmlRes = await fetch('https://natureco.me/cli/', {
|
|
93
|
+
headers: { 'User-Agent': 'NatureCo-CLI/2.0' },
|
|
94
|
+
signal: AbortSignal.timeout(3000),
|
|
95
|
+
});
|
|
96
|
+
if (htmlRes.ok) {
|
|
97
|
+
const html = await htmlRes.text();
|
|
98
|
+
const lines = html.split('\n').filter(l => l.toLowerCase().includes(query.toLowerCase()));
|
|
99
|
+
if (lines.length > 0) {
|
|
100
|
+
found = true;
|
|
101
|
+
console.log(chalk.cyan(' NatureCo CLI Docs Page\n'));
|
|
102
|
+
console.log(chalk.gray(' ' + '─'.repeat(48)));
|
|
103
|
+
for (const line of lines.slice(0, 5)) {
|
|
104
|
+
const clean = line.replace(/<[^>]*>/g, '').trim();
|
|
105
|
+
if (clean) console.log(` ${chalk.white(clean.substring(0, 120))}`);
|
|
106
|
+
}
|
|
107
|
+
console.log(`\n ${chalk.cyan('https://natureco.me/cli/')}`);
|
|
108
|
+
console.log();
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
} catch {}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
if (!found) {
|
|
115
|
+
console.log(chalk.gray(' No documentation found for this query.'));
|
|
116
|
+
console.log(chalk.gray('\n Try browsing:'));
|
|
117
|
+
console.log(chalk.cyan(' https://natureco.me/cli/'));
|
|
118
|
+
console.log(chalk.cyan(' https://developers.natureco.me/'));
|
|
119
|
+
console.log();
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
function showHelp() {
|
|
124
|
+
console.log(chalk.cyan('\n NatureCo Docs Search\n'));
|
|
125
|
+
console.log(chalk.gray(' ' + '─'.repeat(48)));
|
|
126
|
+
console.log(chalk.gray(' Search NatureCo documentation from multiple sources.\n'));
|
|
127
|
+
console.log(chalk.gray(' Usage:'));
|
|
128
|
+
console.log(chalk.cyan(' natureco docs <search query>'));
|
|
129
|
+
console.log(chalk.gray('\n Examples:'));
|
|
130
|
+
console.log(chalk.gray(' natureco docs gateway setup'));
|
|
131
|
+
console.log(chalk.gray(' natureco docs telegram channel'));
|
|
132
|
+
console.log(chalk.gray(' natureco docs api reference'));
|
|
133
|
+
console.log();
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
module.exports = docs;
|