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,237 @@
1
+ const chalk = require('chalk');
2
+ const { getConfig } = require('../utils/config');
3
+
4
+ const CAPABILITY_MODEL_PATTERNS = {
5
+ chat: { patterns: ['llama', 'gpt', 'claude', 'mixtral', 'gemma', 'deepseek', 'mistral', 'grok', 'command'] },
6
+ vision: { patterns: ['vision', 'gpt-4o', 'gpt-4-turbo', 'claude', 'llama-3.2', 'llama-3.3', 'grok-vision'] },
7
+ embeddings: { patterns: ['embedding', 'text-embedding', 'gte', 'e5-'] },
8
+ tts: { patterns: ['tts', 'eleven', 'playai'] },
9
+ stt: { patterns: ['whisper', 'deepgram', 'distil-whisper', 'stt'] },
10
+ images: { patterns: ['dall-e', 'dall-e-3', 'stable-diffusion', 'sdxl', 'flux', 'imagen'] },
11
+ video: { patterns: ['runway', 'pika', 'sora', 'video'] },
12
+ music: { patterns: ['suno', 'udio', 'music'] },
13
+ audio: { patterns: ['audio', 'whisper', 'bark'] },
14
+ code: { patterns: ['code', 'deepseek-coder', 'codestral', 'qwen-coder'] },
15
+ search: { patterns: ['search', 'tavily', 'perplexity', 'exa'] },
16
+ reasoning: { patterns: ['reasoner', 'reasoning', 'deepseek-reasoner', 'o1', 'o3'] },
17
+ };
18
+
19
+ async function capability(args) {
20
+ const [action, ...params] = args || [];
21
+
22
+ if (!action || action === 'list') return listCapabilities();
23
+ if (action === 'infer' || action === 'check') return inferCapabilities(params[0]);
24
+
25
+ console.log(chalk.red(`\n ❌ Bilinmeyen komut: ${action}\n`));
26
+ console.log(chalk.gray(' Kullanım: natureco capability [list|infer]\n'));
27
+ process.exit(1);
28
+ }
29
+
30
+ async function listCapabilities() {
31
+ const config = getConfig();
32
+ const providerUrl = config.providerUrl || '';
33
+ const apiKey = config.providerApiKey || '';
34
+
35
+ const providerHost = providerUrl.replace('https://', '').split('/')[0] || 'yapılandırılmamış';
36
+
37
+ console.log(chalk.cyan('\n Provider Capabilities\n'));
38
+ console.log(chalk.gray(' ' + '─'.repeat(48)));
39
+ console.log(chalk.gray(` Provider: ${providerHost}\n`));
40
+
41
+ let liveModels = [];
42
+ if (apiKey && providerUrl) {
43
+ try {
44
+ const endpoint = providerUrl.replace(/\/v1\/.*$|\/$/, '') + '/v1/models';
45
+ const res = await fetch(endpoint, {
46
+ headers: { Authorization: `Bearer ${apiKey}`, 'Content-Type': 'application/json' },
47
+ signal: AbortSignal.timeout(5000),
48
+ });
49
+ if (res.ok) {
50
+ const data = await res.json();
51
+ liveModels = (data.data || data.models || []).map(m => ({ id: m.id || m }));
52
+ }
53
+ } catch {}
54
+ }
55
+
56
+ const capabilities = {
57
+ chat: { providers: [], status: false },
58
+ vision: { providers: [], status: false },
59
+ code: { providers: [], status: false },
60
+ reasoning: { providers: [], status: false },
61
+ embeddings: { providers: [], status: false },
62
+ tts: { providers: [], status: false },
63
+ stt: { providers: [], status: false },
64
+ images: { providers: [], status: false },
65
+ audio: { providers: [], status: false },
66
+ search: { providers: [], status: false },
67
+ };
68
+
69
+ if (liveModels.length > 0) {
70
+ for (const [cap, def] of Object.entries(CAPABILITY_MODEL_PATTERNS)) {
71
+ const matched = liveModels.filter(m =>
72
+ def.patterns.some(p => m.id.toLowerCase().includes(p))
73
+ );
74
+ if (matched.length > 0) {
75
+ capabilities[cap].providers = [providerHost];
76
+ capabilities[cap].status = true;
77
+ capabilities[cap].models = matched.map(m => m.id).slice(0, 5);
78
+ }
79
+ }
80
+ } else {
81
+ const knownModels = getKnownProviderModels(providerUrl);
82
+ for (const [cap, def] of Object.entries(CAPABILITY_MODEL_PATTERNS)) {
83
+ const matched = knownModels.filter(m =>
84
+ def.patterns.some(p => m.toLowerCase().includes(p))
85
+ );
86
+ if (matched.length > 0) {
87
+ capabilities[cap].providers = [providerHost];
88
+ capabilities[cap].status = true;
89
+ }
90
+ }
91
+ }
92
+
93
+ if (apiKey && !capabilities.chat.status) {
94
+ capabilities.chat.status = true;
95
+ capabilities.chat.providers = [providerHost];
96
+ }
97
+
98
+ for (const [cap, info] of Object.entries(capabilities)) {
99
+ const icon = info.status ? chalk.green('●') : chalk.gray('○');
100
+ const detail = info.status && info.models
101
+ ? chalk.gray('(' + info.models.join(', ') + ')')
102
+ : '';
103
+ console.log(` ${icon} ${chalk.white(cap.padEnd(12))} ${detail}`);
104
+ }
105
+
106
+ console.log(chalk.gray('\n Capabilities are inferred from available models.\n'));
107
+ console.log(chalk.gray(' Detaylı sorgu: ') + chalk.cyan('natureco capability infer <provider>\n'));
108
+ }
109
+
110
+ function getKnownProviderModels(providerUrl) {
111
+ const providerModels = {
112
+ 'api.groq.com': ['llama-3.3-70b-versatile', 'llama-3.1-8b-instant', 'llama-3.2-90b-vision-preview', 'llama-3.1-70b-versatile', 'mixtral-8x7b-32768', 'gemma2-9b-it', 'llama-guard-3-8b', 'llama-3.2-1b-preview', 'llama-3.2-3b-preview', 'distil-whisper-large-v3-en'],
113
+ 'api.openai.com': ['gpt-4o', 'gpt-4o-mini', 'gpt-4-turbo', 'gpt-4', 'gpt-3.5-turbo', 'o1-preview', 'o1-mini', 'dall-e-3', 'tts-1', 'whisper-1', 'text-embedding-3-large'],
114
+ 'api.anthropic.com': ['claude-opus-4-7', 'claude-sonnet-4-6', 'claude-haiku-4-5-20251001', 'claude-3-5-sonnet-20241022', 'claude-3-haiku-20240307'],
115
+ 'api.together.xyz': ['meta-llama/Meta-Llama-3.1-70B-Instruct-Turbo', 'meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo', 'meta-llama/Llama-3.2-90B-Vision-Instruct-Turbo', 'mistralai/Mixtral-8x7B-Instruct-v0.1', 'deepseek-ai/deepseek-coder-33b-instruct'],
116
+ 'api.deepseek.com': ['deepseek-chat', 'deepseek-coder', 'deepseek-reasoner'],
117
+ 'api.mistral.ai': ['mistral-large-latest', 'mistral-medium-latest', 'mistral-small-latest', 'codestral-latest'],
118
+ 'api.perplexity.ai': ['sonar-pro', 'sonar', 'sonar-reasoning-pro'],
119
+ 'api.x.ai': ['grok-beta', 'grok-vision-beta'],
120
+ 'api.deepinfra.com': ['meta-llama/Meta-Llama-3.1-70B-Instruct', 'meta-llama/Meta-Llama-3.1-8B-Instruct', 'mistralai/Mixtral-8x22B-Instruct-v0.1'],
121
+ 'fireworks.ai': ['accounts/fireworks/models/llama-v3p1-70b-instruct', 'accounts/fireworks/models/llama-v3p1-8b-instruct'],
122
+ 'openrouter.ai': ['openrouter/auto'],
123
+ };
124
+ for (const [domain, models] of Object.entries(providerModels)) {
125
+ if (providerUrl.includes(domain)) return models;
126
+ }
127
+ if (providerUrl.includes('openai') || providerUrl.includes('v1')) {
128
+ return providerModels['api.openai.com'];
129
+ }
130
+ return [];
131
+ }
132
+
133
+ async function inferCapabilities(provider) {
134
+ if (!provider) {
135
+ console.log(chalk.red('\n ❌ Provider adı gerekli\n'));
136
+ process.exit(1);
137
+ }
138
+
139
+ const config = getConfig();
140
+ const apiKey = config[`${provider}ApiKey`] || process.env[`${provider.toUpperCase()}_API_KEY`];
141
+
142
+ console.log(chalk.cyan(`\n Inferring capabilities for: ${provider}\n`));
143
+ console.log(chalk.gray(' ' + '─'.repeat(48)));
144
+
145
+ if (!apiKey) {
146
+ console.log(chalk.red(` ❌ No API key for ${provider}\n`));
147
+ process.exit(1);
148
+ }
149
+
150
+ const urls = {
151
+ openai: 'https://api.openai.com',
152
+ groq: 'https://api.groq.com/openai',
153
+ anthropic: 'https://api.anthropic.com',
154
+ deepseek: 'https://api.deepseek.com',
155
+ mistral: 'https://api.mistral.ai',
156
+ xai: 'https://api.x.ai',
157
+ together: 'https://api.together.xyz',
158
+ perplexity: 'https://api.perplexity.ai',
159
+ deepinfra: 'https://api.deepinfra.com',
160
+ fireworks: 'https://api.fireworks.ai',
161
+ openrouter: 'https://openrouter.ai',
162
+ };
163
+
164
+ const baseUrl = urls[provider] || `${config.providerUrl || ''}`;
165
+ if (!baseUrl) {
166
+ console.log(chalk.red(` ❌ Bilinmeyen provider: ${provider}\n`));
167
+ process.exit(1);
168
+ }
169
+
170
+ const modelsEndpoint = baseUrl.replace(/\/$/, '') + '/v1/models';
171
+ let models = [];
172
+ let probeError = null;
173
+
174
+ console.log(` ${chalk.gray('Fetching models...')}`);
175
+
176
+ try {
177
+ const res = await fetch(modelsEndpoint, {
178
+ headers: { Authorization: `Bearer ${apiKey}`, 'Content-Type': 'application/json' },
179
+ signal: AbortSignal.timeout(5000),
180
+ });
181
+ if (res.ok) {
182
+ const data = await res.json();
183
+ models = (data.data || data.models || []).map(m => m.id || m);
184
+ console.log(` ${chalk.green('✓')} ${chalk.white('models')}: ${chalk.gray(`${models.length} model found`)}`);
185
+ } else if (res.status === 401) {
186
+ probeError = 'Geçersiz API key';
187
+ console.log(` ${chalk.red('✗')} ${chalk.white('models')}: ${chalk.red(probeError)}`);
188
+ } else if (res.status === 404) {
189
+ console.log(` ${chalk.yellow('⚠')} ${chalk.white('models')}: ${chalk.gray('Provider does not expose /v1/models')}`);
190
+ } else {
191
+ console.log(` ${chalk.yellow('⚠')} ${chalk.white('models')}: ${chalk.gray(`HTTP ${res.status}`)}`);
192
+ }
193
+ } catch (err) {
194
+ console.log(` ${chalk.red('✗')} ${chalk.white('models')}: ${chalk.red(err.message)}`);
195
+ }
196
+
197
+ const capabilities = ['chat', 'vision', 'code', 'reasoning', 'embeddings', 'tts', 'stt', 'images', 'audio'];
198
+ for (const cap of capabilities) {
199
+ const def = CAPABILITY_MODEL_PATTERNS[cap];
200
+ const matched = models.filter(m => def.patterns.some(p => m.toLowerCase().includes(p)));
201
+ if (matched.length > 0) {
202
+ console.log(` ${chalk.green('✓')} ${chalk.white(cap.padEnd(12))}: ${chalk.gray(matched.slice(0, 3).join(', '))}`);
203
+ } else if (!probeError && models.length > 0) {
204
+ console.log(` ${chalk.gray('○')} ${chalk.white(cap.padEnd(12))}: ${chalk.gray('not detected')}`);
205
+ } else if (probeError) {
206
+ console.log(` ${chalk.gray('○')} ${chalk.white(cap.padEnd(12))}: ${chalk.gray('unavailable')}`);
207
+ }
208
+ }
209
+
210
+ if (models.length > 0) {
211
+ console.log(`\n ${chalk.green('✓')} ${chalk.white('chat')}: ${chalk.green('confirmed')}`);
212
+ try {
213
+ const chatUrl = baseUrl.replace(/\/$/, '') + '/v1/chat/completions';
214
+ const testRes = await fetch(chatUrl, {
215
+ method: 'POST',
216
+ headers: { Authorization: `Bearer ${apiKey}`, 'Content-Type': 'application/json' },
217
+ body: JSON.stringify({
218
+ model: models[0],
219
+ messages: [{ role: 'user', content: 'say ok' }],
220
+ max_tokens: 5,
221
+ }),
222
+ signal: AbortSignal.timeout(5000),
223
+ });
224
+ if (testRes.ok) {
225
+ console.log(` ${chalk.green('✓')} ${chalk.white('chat_test')}: ${chalk.green('working')}`);
226
+ } else {
227
+ console.log(` ${chalk.yellow('⚠')} ${chalk.white('chat_test')}: ${chalk.gray(`HTTP ${testRes.status}`)}`);
228
+ }
229
+ } catch (err) {
230
+ console.log(` ${chalk.yellow('⚠')} ${chalk.white('chat_test')}: ${chalk.gray(err.message)}`);
231
+ }
232
+ }
233
+
234
+ console.log();
235
+ }
236
+
237
+ module.exports = capability;