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.
Files changed (111) hide show
  1. package/README.md +94 -11
  2. package/bin/natureco.js +495 -94
  3. package/package.json +1 -1
  4. package/src/commands/acp.js +39 -0
  5. package/src/commands/admin-rpc.js +302 -0
  6. package/src/commands/agent.js +280 -0
  7. package/src/commands/agents.js +114 -30
  8. package/src/commands/approvals.js +214 -0
  9. package/src/commands/backup.js +124 -0
  10. package/src/commands/bonjour.js +167 -0
  11. package/src/commands/browser.js +815 -0
  12. package/src/commands/capability.js +237 -0
  13. package/src/commands/channels.js +422 -267
  14. package/src/commands/chat.js +5 -8
  15. package/src/commands/clawbot.js +19 -0
  16. package/src/commands/clickclack.js +130 -0
  17. package/src/commands/code.js +3 -2
  18. package/src/commands/commitments.js +148 -0
  19. package/src/commands/completion.js +84 -0
  20. package/src/commands/config.js +219 -30
  21. package/src/commands/configure.js +110 -0
  22. package/src/commands/crestodian.js +92 -0
  23. package/src/commands/cron.js +239 -19
  24. package/src/commands/daemon.js +90 -0
  25. package/src/commands/dashboard.js +47 -374
  26. package/src/commands/device-pair.js +248 -0
  27. package/src/commands/devices.js +137 -0
  28. package/src/commands/directory.js +179 -0
  29. package/src/commands/dns.js +196 -0
  30. package/src/commands/docs.js +136 -0
  31. package/src/commands/doctor.js +143 -492
  32. package/src/commands/exec-policy.js +80 -0
  33. package/src/commands/gateway-server.js +1155 -24
  34. package/src/commands/gateway.js +492 -249
  35. package/src/commands/health.js +148 -0
  36. package/src/commands/help.js +24 -25
  37. package/src/commands/hooks.js +141 -87
  38. package/src/commands/imessage.js +128 -14
  39. package/src/commands/infer.js +1474 -0
  40. package/src/commands/irc.js +64 -15
  41. package/src/commands/logs.js +122 -99
  42. package/src/commands/mattermost.js +114 -12
  43. package/src/commands/mcp.js +121 -309
  44. package/src/commands/memory-cmd.js +134 -1
  45. package/src/commands/memory.js +128 -0
  46. package/src/commands/message.js +720 -134
  47. package/src/commands/migrate.js +213 -2
  48. package/src/commands/models.js +39 -1
  49. package/src/commands/node.js +98 -0
  50. package/src/commands/nodes.js +362 -0
  51. package/src/commands/oc-path.js +200 -0
  52. package/src/commands/onboard.js +129 -0
  53. package/src/commands/open-prose.js +67 -0
  54. package/src/commands/pairing.js +108 -107
  55. package/src/commands/path.js +206 -0
  56. package/src/commands/plugins.js +35 -1
  57. package/src/commands/policy.js +176 -0
  58. package/src/commands/proxy.js +306 -0
  59. package/src/commands/qr.js +70 -0
  60. package/src/commands/reset.js +101 -94
  61. package/src/commands/sandbox.js +125 -0
  62. package/src/commands/secrets.js +201 -0
  63. package/src/commands/sessions.js +110 -51
  64. package/src/commands/setup.js +102 -543
  65. package/src/commands/signal.js +447 -18
  66. package/src/commands/skills.js +67 -1
  67. package/src/commands/sms.js +123 -19
  68. package/src/commands/status.js +101 -127
  69. package/src/commands/system.js +53 -0
  70. package/src/commands/tasks.js +208 -100
  71. package/src/commands/terminal.js +139 -0
  72. package/src/commands/thread-ownership.js +157 -0
  73. package/src/commands/transcripts.js +95 -0
  74. package/src/commands/tui.js +41 -0
  75. package/src/commands/uninstall.js +73 -92
  76. package/src/commands/update.js +146 -91
  77. package/src/commands/voice.js +82 -0
  78. package/src/commands/vydra.js +98 -0
  79. package/src/commands/webhooks.js +58 -66
  80. package/src/commands/wiki.js +783 -0
  81. package/src/commands/workboard.js +207 -0
  82. package/src/tools/audio_understanding.js +154 -0
  83. package/src/tools/browser.js +112 -0
  84. package/src/tools/canvas.js +104 -0
  85. package/src/tools/document_extract.js +84 -0
  86. package/src/tools/duckduckgo.js +54 -0
  87. package/src/tools/exa_search.js +66 -0
  88. package/src/tools/firecrawl.js +104 -0
  89. package/src/tools/image_generation.js +99 -0
  90. package/src/tools/llm_task.js +118 -0
  91. package/src/tools/media_understanding.js +128 -0
  92. package/src/tools/music_generation.js +113 -0
  93. package/src/tools/parallel_search.js +77 -0
  94. package/src/tools/phone_control.js +80 -0
  95. package/src/tools/phone_control_enhanced.js +184 -0
  96. package/src/tools/searxng.js +61 -0
  97. package/src/tools/speech_to_text.js +135 -0
  98. package/src/tools/text_to_speech.js +105 -0
  99. package/src/tools/thread_ownership.js +88 -0
  100. package/src/tools/video_generation.js +72 -0
  101. package/src/tools/web_readability.js +104 -0
  102. package/src/utils/agents-md.js +85 -0
  103. package/src/utils/api.js +39 -40
  104. package/src/utils/format.js +144 -0
  105. package/src/utils/headless.js +2 -1
  106. package/src/utils/memory.js +200 -0
  107. package/src/utils/parallel-tools.js +106 -0
  108. package/src/utils/sub-agent.js +148 -0
  109. package/src/utils/token-budget.js +304 -0
  110. package/src/utils/tool-runner.js +7 -5
  111. package/src/utils/web-fetch.js +107 -0
@@ -0,0 +1,167 @@
1
+ const chalk = require('chalk');
2
+ const { getConfig, saveConfig } = require('../utils/config');
3
+ const dns = require('dns');
4
+ const os = require('os');
5
+
6
+ function discoverGateway() {
7
+ return new Promise((resolve) => {
8
+ const interfaces = os.networkInterfaces();
9
+ let gateway = null;
10
+
11
+ for (const [name, addrs] of Object.entries(interfaces)) {
12
+ if (!addrs) continue;
13
+ for (const addr of addrs) {
14
+ if (addr.family === 'IPv4' && !addr.internal) {
15
+ // Try common gateway addresses
16
+ const parts = addr.address.split('.');
17
+ for (const gw of [
18
+ `${parts[0]}.${parts[1]}.${parts[2]}.1`,
19
+ `${parts[0]}.${parts[1]}.${parts[2]}.254`
20
+ ]) {
21
+ const sock = new (require('net').Socket)();
22
+ sock.setTimeout(500);
23
+ sock.on('connect', () => { sock.destroy(); if (!gateway) gateway = gw; });
24
+ sock.on('error', () => {});
25
+ sock.on('timeout', () => sock.destroy());
26
+ sock.connect(80, gw);
27
+ }
28
+ }
29
+ }
30
+ }
31
+
32
+ setTimeout(() => resolve(gateway), 1000);
33
+ });
34
+ }
35
+
36
+ async function bonjour(args) {
37
+ const [action, ...params] = (args || []);
38
+
39
+ if (!action || action === 'scan') return scanNetwork();
40
+ if (action === 'discover') return discoverServices();
41
+ if (action === 'status') return statusBonjour();
42
+
43
+ console.log(chalk.red(`\n ❌ Bilinmeyen komut: ${action}\n`));
44
+ console.log(chalk.gray(' Kullanım: natureco bonjour [scan|discover|status]\n'));
45
+ process.exit(1);
46
+ }
47
+
48
+ async function scanNetwork() {
49
+ console.log(chalk.cyan('\n Ağ taranıyor...\n'));
50
+
51
+ const interfaces = os.networkInterfaces();
52
+ const found = [];
53
+
54
+ for (const [name, addrs] of Object.entries(interfaces)) {
55
+ if (!addrs) continue;
56
+ for (const addr of addrs) {
57
+ if (addr.family === 'IPv4' && !addr.internal) {
58
+ found.push({
59
+ interface: name,
60
+ address: addr.address,
61
+ netmask: addr.netmask,
62
+ mac: addr.mac
63
+ });
64
+ }
65
+ }
66
+ }
67
+
68
+ if (found.length === 0) {
69
+ console.log(chalk.gray(' Ağ arayüzü bulunamadı.\n'));
70
+ return;
71
+ }
72
+
73
+ const gateway = await discoverGateway();
74
+
75
+ console.log(chalk.gray(' ' + '─'.repeat(48)));
76
+ console.log(chalk.cyan.bold('\n Ağ Arayüzleri\n'));
77
+
78
+ found.forEach(f => {
79
+ console.log(chalk.white(` ${f.interface}`));
80
+ console.log(chalk.gray(` IP: ${f.address}`));
81
+ console.log(chalk.gray(` MAC: ${f.mac}`));
82
+ });
83
+
84
+ if (gateway) {
85
+ console.log(chalk.gray('\n Varsayılan ağ geçidi: ') + chalk.cyan(gateway));
86
+ }
87
+
88
+ console.log(chalk.gray('\n Service discovery için: ') + chalk.cyan('natureco bonjour discover\n'));
89
+ }
90
+
91
+ async function discoverServices() {
92
+ console.log(chalk.cyan('\n Servis keşfi başlatılıyor...\n'));
93
+
94
+ // Try common ports
95
+ const commonServices = [
96
+ { name: 'HTTP', port: 80 },
97
+ { name: 'HTTPS', port: 443 },
98
+ { name: 'SSH', port: 22 },
99
+ { name: 'NatureCo Gateway', port: 3848 },
100
+ { name: 'Dashboard', port: 3849 },
101
+ { name: 'OpenClaw', port: 3000 },
102
+ { name: 'MCP', port: 3100 }
103
+ ];
104
+
105
+ const config = getConfig();
106
+ const additionalPorts = config.discoveryPorts || [];
107
+ const allServices = [...commonServices, ...additionalPorts.map(p => ({ name: `Port ${p}`, port: p }))];
108
+
109
+ const interfaces = os.networkInterfaces();
110
+ const results = [];
111
+
112
+ for (const [, addrs] of Object.entries(interfaces)) {
113
+ if (!addrs) continue;
114
+ for (const addr of addrs) {
115
+ if (addr.family === 'IPv4' && !addr.internal) {
116
+ const base = addr.address.split('.').slice(0, 3).join('.');
117
+ for (let i = 1; i <= 5; i++) {
118
+ const host = `${base}.${i}`;
119
+ for (const svc of allServices) {
120
+ try {
121
+ await new Promise((resolve, reject) => {
122
+ const sock = new (require('net').Socket)();
123
+ sock.setTimeout(200);
124
+ sock.on('connect', () => {
125
+ sock.destroy();
126
+ results.push({ host, port: svc.port, service: svc.name });
127
+ resolve();
128
+ });
129
+ sock.on('error', () => reject());
130
+ sock.on('timeout', () => reject());
131
+ sock.connect(svc.port, host);
132
+ });
133
+ } catch {}
134
+ }
135
+ }
136
+ }
137
+ }
138
+ }
139
+
140
+ if (results.length === 0) {
141
+ console.log(chalk.gray(' Servis bulunamadı.\n'));
142
+ return;
143
+ }
144
+
145
+ console.log(chalk.gray(' ' + '─'.repeat(48)));
146
+ console.log(chalk.cyan.bold('\n Bulunan Servisler\n'));
147
+
148
+ results.forEach(r => {
149
+ console.log(` ${chalk.green('●')} ${chalk.white(r.service)} ${chalk.gray(`→ ${r.host}:${r.port}`)}`);
150
+ });
151
+
152
+ console.log(chalk.gray('\n Özel port eklemek: ') + chalk.cyan('natureco config set discoveryPorts [3000,4000]\n'));
153
+ }
154
+
155
+ function statusBonjour() {
156
+ console.log(chalk.gray('\n Bonjour/mDNS Servis Keşfi\n'));
157
+ console.log(chalk.gray(' ' + '─'.repeat(48)));
158
+ console.log(chalk.gray(' Ağ keşif aracı — NatureCo servislerini ve gateway\'i bulur.'));
159
+ console.log(chalk.gray(' Komutlar:'));
160
+ console.log(chalk.cyan(' scan ') + chalk.gray('Ağ arayüzlerini ve IP\'leri listele'));
161
+ console.log(chalk.cyan(' discover ') + chalk.gray('Yerel ağda NatureCo servislerini ara'));
162
+ console.log(chalk.gray('\n Port yapılandırması:'));
163
+ console.log(chalk.gray(' Varsayılan: 3848 (Gateway), 3849 (Dashboard)'));
164
+ console.log(chalk.gray(' Özel: ') + chalk.cyan('natureco config set discoveryPorts [3000,4000]\n'));
165
+ }
166
+
167
+ module.exports = bonjour;