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
|
@@ -1,7 +1,22 @@
|
|
|
1
1
|
const chalk = require('chalk');
|
|
2
2
|
const { getConfig } = require('../utils/config');
|
|
3
3
|
|
|
4
|
-
|
|
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) {
|
|
5
20
|
const [action, ...params] = args || [];
|
|
6
21
|
|
|
7
22
|
if (!action || action === 'list') return listCapabilities();
|
|
@@ -12,32 +27,110 @@ function capability(args) {
|
|
|
12
27
|
process.exit(1);
|
|
13
28
|
}
|
|
14
29
|
|
|
15
|
-
function listCapabilities() {
|
|
30
|
+
async function listCapabilities() {
|
|
16
31
|
const config = getConfig();
|
|
17
|
-
|
|
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'));
|
|
18
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
|
+
}
|
|
19
55
|
|
|
20
56
|
const capabilities = {
|
|
21
|
-
chat: [
|
|
22
|
-
vision: [
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
tts: [
|
|
27
|
-
stt: [
|
|
28
|
-
|
|
29
|
-
|
|
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 },
|
|
30
67
|
};
|
|
31
68
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
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];
|
|
35
96
|
}
|
|
36
97
|
|
|
37
|
-
|
|
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 [];
|
|
38
131
|
}
|
|
39
132
|
|
|
40
|
-
function inferCapabilities(provider) {
|
|
133
|
+
async function inferCapabilities(provider) {
|
|
41
134
|
if (!provider) {
|
|
42
135
|
console.log(chalk.red('\n ❌ Provider adı gerekli\n'));
|
|
43
136
|
process.exit(1);
|
|
@@ -46,7 +139,7 @@ function inferCapabilities(provider) {
|
|
|
46
139
|
const config = getConfig();
|
|
47
140
|
const apiKey = config[`${provider}ApiKey`] || process.env[`${provider.toUpperCase()}_API_KEY`];
|
|
48
141
|
|
|
49
|
-
console.log(chalk.cyan(`\n
|
|
142
|
+
console.log(chalk.cyan(`\n Inferring capabilities for: ${provider}\n`));
|
|
50
143
|
console.log(chalk.gray(' ' + '─'.repeat(48)));
|
|
51
144
|
|
|
52
145
|
if (!apiKey) {
|
|
@@ -54,10 +147,90 @@ function inferCapabilities(provider) {
|
|
|
54
147
|
process.exit(1);
|
|
55
148
|
}
|
|
56
149
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
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
|
+
|
|
61
234
|
console.log();
|
|
62
235
|
}
|
|
63
236
|
|