natureco-cli 5.10.0 → 5.13.0
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/package.json +1 -1
- package/src/tools/workflow.js +332 -0
- package/src/utils/system-prompt.js +3 -0
- package/src/utils/tools.js +3 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "natureco-cli",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.13.0",
|
|
4
4
|
"description": "OpenClaw'dan daha güvenli, daha hızlı, daha ucuz AI agent CLI. Multi-agent, self-evolving skills, audit log, maliyet optimizasyonu ve NatureCo platform-native.",
|
|
5
5
|
"bin": {
|
|
6
6
|
"natureco": "bin/natureco.js"
|
|
@@ -0,0 +1,332 @@
|
|
|
1
|
+
const https = require('https');
|
|
2
|
+
const fs = require('fs');
|
|
3
|
+
const path = require('path');
|
|
4
|
+
const os = require('os');
|
|
5
|
+
|
|
6
|
+
const WORKFLOW_DIR = path.join(os.homedir(), '.natureco', 'workflows');
|
|
7
|
+
const WORKFLOW_HISTORY = path.join(os.homedir(), '.natureco', 'workflow-history.json');
|
|
8
|
+
|
|
9
|
+
function ensureDir(dir) { try { fs.mkdirSync(dir, { recursive: true }); } catch {} }
|
|
10
|
+
function loadConfig() {
|
|
11
|
+
try { return JSON.parse(fs.readFileSync(path.join(os.homedir(), '.natureco', 'config.json'), 'utf8')); } catch { return {}; }
|
|
12
|
+
}
|
|
13
|
+
function isMiniMax(url) { return url && (url.includes('minimax.io') || url.includes('minimaxi.com') || url.includes('minimax.cn')); }
|
|
14
|
+
function isGemini(url) { return url && (url.includes('generativelanguage.googleapis.com') || url.includes('gemini')); }
|
|
15
|
+
|
|
16
|
+
function allToolNames() {
|
|
17
|
+
try {
|
|
18
|
+
const toolsDir = path.join(__dirname, '..', 'tools');
|
|
19
|
+
return fs.readdirSync(toolsDir).filter(f => f.endsWith('.js')).map(f => path.basename(f, '.js'));
|
|
20
|
+
} catch { return []; }
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function apiCall(providerUrl, apiKey, body) {
|
|
24
|
+
return new Promise((resolve, reject) => {
|
|
25
|
+
const base = providerUrl.replace(/\/+$/, '');
|
|
26
|
+
const endpoint = isMiniMax(base)
|
|
27
|
+
? base + '/v1/text/chatcompletion_v2'
|
|
28
|
+
: isGemini(base)
|
|
29
|
+
? base + '/openai/chat/completions'
|
|
30
|
+
: base + '/chat/completions';
|
|
31
|
+
const req = https.request(endpoint, {
|
|
32
|
+
method: 'POST',
|
|
33
|
+
headers: { 'Authorization': 'Bearer ' + apiKey, 'Content-Type': 'application/json' },
|
|
34
|
+
timeout: 120000,
|
|
35
|
+
}, (res) => {
|
|
36
|
+
let data = '';
|
|
37
|
+
res.on('data', c => data += c);
|
|
38
|
+
res.on('end', () => {
|
|
39
|
+
if (res.statusCode >= 200 && res.statusCode < 300) {
|
|
40
|
+
try { resolve(JSON.parse(data)); } catch { reject(new Error('Parse hatasi')); }
|
|
41
|
+
} else if (res.statusCode === 429) {
|
|
42
|
+
reject(new Error('429: API rate limit. Bekleyip tekrar deneyin.'));
|
|
43
|
+
} else {
|
|
44
|
+
reject(new Error('HTTP ' + res.statusCode + ': ' + data.slice(0, 300)));
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
req.on('error', reject);
|
|
49
|
+
req.on('timeout', () => { req.destroy(); reject(new Error('Timeout')); });
|
|
50
|
+
req.write(JSON.stringify(body));
|
|
51
|
+
req.end();
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
async function workflow(params) {
|
|
56
|
+
const { action, task, steps, name, workflowId, regenerateStep } = params;
|
|
57
|
+
const cfg = loadConfig();
|
|
58
|
+
const tools = allToolNames();
|
|
59
|
+
ensureDir(WORKFLOW_DIR);
|
|
60
|
+
|
|
61
|
+
const providerUrl = cfg.providerUrl;
|
|
62
|
+
const providerApiKey = cfg.providerApiKey;
|
|
63
|
+
const model = cfg.providerModel || 'default';
|
|
64
|
+
|
|
65
|
+
if (!providerUrl || !providerApiKey) {
|
|
66
|
+
return { success: false, error: 'Provider ayarli degil. Once: natureco setup' };
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// ── RUN: Execute a complete workflow ──────────────────────────────────
|
|
70
|
+
if (action === 'run') {
|
|
71
|
+
if (!task) return { success: false, error: 'task gerekli' };
|
|
72
|
+
|
|
73
|
+
// Phase 0: Check if simple chat (passthrough) — no planning needed
|
|
74
|
+
const simpleCheckPrompt = {
|
|
75
|
+
role: 'system',
|
|
76
|
+
content: 'Gorevin basit bir selamlasma/sohbet mi yoksa arac gerektiren bir islem mi oldugunu belirle. Sadece "simple" veya "complex" yaz, baska bir sey yazma.\n\nSimple: selamlasma, nasilsin, bugun ne yaptin, havadan sudan, genel bilgi sorusu\nComplex: dosya islemleri, kod yazma, arastirma, karsilastirma, duzenleme, otomasyon, proje yonetimi, debug'
|
|
77
|
+
};
|
|
78
|
+
const simpleBody = { model, stream: false, messages: [simpleCheckPrompt, { role: 'user', content: task }], temperature: 0, max_tokens: 10 };
|
|
79
|
+
let isSimple = false;
|
|
80
|
+
try {
|
|
81
|
+
const simpleResult = await apiCall(providerUrl, providerApiKey, simpleBody);
|
|
82
|
+
const simpleAnswer = (simpleResult.choices?.[0]?.message?.content || '').trim().toLowerCase();
|
|
83
|
+
isSimple = simpleAnswer === 'simple';
|
|
84
|
+
} catch {}
|
|
85
|
+
|
|
86
|
+
if (isSimple) {
|
|
87
|
+
// Passthrough: just chat with LLM, no tools
|
|
88
|
+
const chatBody = { model, stream: false, messages: [{ role: 'system', content: 'Sen yardimci bir asistansin. Kisa ve oz yanit ver.' }, { role: 'user', content: task }], temperature: 0.7, max_tokens: 1000 };
|
|
89
|
+
try {
|
|
90
|
+
const chatResult = await apiCall(providerUrl, providerApiKey, chatBody);
|
|
91
|
+
const reply = chatResult.choices?.[0]?.message?.content || '';
|
|
92
|
+
return { success: true, workflowId: 'passthrough', name: 'Direct Chat', status: 'completed', totalSteps: 0, completedSteps: 0, results: [{ step: 0, tool: 'chat', status: 'done', result: { reply } }], passthrough: true, reply };
|
|
93
|
+
} catch (e) {
|
|
94
|
+
return { success: false, error: 'Sohbet yaniti alinamadi: ' + e.message };
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
// Phase 1: LLM plans the workflow
|
|
99
|
+
const planPrompt = {
|
|
100
|
+
role: 'system',
|
|
101
|
+
content: 'Sen bir workflow planlama asistanisin. Verilen gorev icin hangi tool\'larin kullanilacagini ve hangi sirayla calisacagini belirle. SADECE JSON formatinda yanit ver, baska bir sey yazma.\n\nKullanilabilir tool\'lar:\n' +
|
|
102
|
+
tools.map(t => '- ' + t).join('\n') +
|
|
103
|
+
'\n\nJSON format:\n{\n "workflowName": "...",\n "description": "...",\n "steps": [\n { "step": 1, "tool": "tool_name", "purpose": "...", "params": { ... } }\n ]\n}\n\nHer adim icin params kismina tool\'un gerektirdigi parametreleri ekle. Adimlar birbirine bagimli olabilir, onceki adimin outputu sonraki adimin inputu olarak kullanilabilir.'
|
|
104
|
+
};
|
|
105
|
+
const planBody = {
|
|
106
|
+
model, stream: false,
|
|
107
|
+
messages: [planPrompt, { role: 'user', content: 'Gorev: ' + task }],
|
|
108
|
+
temperature: 0.3, max_tokens: 4000,
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
let planResult;
|
|
112
|
+
try {
|
|
113
|
+
planResult = await apiCall(providerUrl, providerApiKey, planBody);
|
|
114
|
+
} catch (e) {
|
|
115
|
+
return { success: false, error: 'Plan olusturulamadi: ' + e.message, phase: 'planning' };
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
let plan;
|
|
119
|
+
try {
|
|
120
|
+
const content = planResult.choices?.[0]?.message?.content || '';
|
|
121
|
+
const jsonMatch = content.match(/\{[\s\S]*\}/);
|
|
122
|
+
plan = JSON.parse(jsonMatch ? jsonMatch[0] : content);
|
|
123
|
+
if (!plan.steps || !Array.isArray(plan.steps)) throw new Error('Steps bulunamadi');
|
|
124
|
+
} catch (e) {
|
|
125
|
+
return { success: false, error: 'Plan cozumlenemedi: ' + e.message, raw: planResult.choices?.[0]?.message?.content?.slice(0, 500) };
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
// Save plan
|
|
129
|
+
const wfId = workflowId || 'wf_' + Date.now().toString(36);
|
|
130
|
+
const wfFile = path.join(WORKFLOW_DIR, wfId + '.json');
|
|
131
|
+
const wfEntry = { id: wfId, task, name: plan.workflowName || task.slice(0, 50), description: plan.description || '', steps: plan.steps, status: 'running', startedAt: new Date().toISOString(), results: [] };
|
|
132
|
+
fs.writeFileSync(wfFile, JSON.stringify(wfEntry, null, 2));
|
|
133
|
+
|
|
134
|
+
// Phase 2: Execute steps sequentially
|
|
135
|
+
const stepResults = [];
|
|
136
|
+
let failed = false;
|
|
137
|
+
|
|
138
|
+
for (const step of plan.steps) {
|
|
139
|
+
if (failed) {
|
|
140
|
+
stepResults.push({ step: step.step, tool: step.tool, status: 'skipped', reason: 'Onceki adim basarisiz' });
|
|
141
|
+
continue;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
// Check if tool is valid
|
|
145
|
+
if (!tools.includes(step.tool)) {
|
|
146
|
+
stepResults.push({ step: step.step, tool: step.tool, status: 'error', error: 'Bilinmeyen tool: ' + step.tool + '. Kullanilabilir: ' + tools.slice(0, 10).join(', ') + '...' });
|
|
147
|
+
failed = true;
|
|
148
|
+
continue;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
// Build the execute prompt — we use LLM to call the tool with correct params
|
|
152
|
+
const executePrompt = {
|
|
153
|
+
role: 'system',
|
|
154
|
+
content: 'Bir sonraki adimi calistiriyorsun. Sana verilen tool\'u ve parametreleri kullanarak islemi gerceklestir. Tool cagrisini dogru formatta yap.\n\nTool: ' + step.tool + '\nAmac: ' + (step.purpose || '') + '\nPlanlanan parametreler: ' + JSON.stringify(step.params || {}) +
|
|
155
|
+
'\n\nOnceki adim sonuclari:\n' + stepResults.map(r => 'Adim ' + r.step + ' (' + r.tool + '): ' + (r.status === 'done' ? JSON.stringify(r.result).slice(0, 300) : r.status)).join('\n') +
|
|
156
|
+
'\n\nTek bir tool cagrisi yap ve sonucu bekle. Tool cagrisi yaparken Onceki adim sonuclarindaki gerekli verileri parametre olarak kullan.'
|
|
157
|
+
};
|
|
158
|
+
const executeBody = {
|
|
159
|
+
model, stream: false,
|
|
160
|
+
messages: [executePrompt, { role: 'user', content: 'Adim ' + step.step + ': ' + step.tool + ' ile ' + (step.purpose || 'islem') + ' yap.' }],
|
|
161
|
+
temperature: 0.2, max_tokens: 2000,
|
|
162
|
+
tools: [{ type: 'function', function: { name: step.tool, description: step.purpose || '', parameters: {} } }],
|
|
163
|
+
tool_choice: { type: 'function', function: { name: step.tool } },
|
|
164
|
+
};
|
|
165
|
+
|
|
166
|
+
let execResult;
|
|
167
|
+
try {
|
|
168
|
+
execResult = await apiCall(providerUrl, providerApiKey, executeBody);
|
|
169
|
+
const msg = execResult.choices?.[0]?.message || {};
|
|
170
|
+
const tc = msg.tool_calls?.[0];
|
|
171
|
+
|
|
172
|
+
if (tc && tc.function) {
|
|
173
|
+
const args = JSON.parse(tc.function.arguments || '{}');
|
|
174
|
+
const toolMod = require(path.join(__dirname, '..', 'tools', step.tool + '.js'));
|
|
175
|
+
const fn = toolMod.execute || (toolMod.default && toolMod.default.execute);
|
|
176
|
+
if (!fn) { throw new Error(step.tool + ' toolunda execute fonksiyonu bulunamadi'); }
|
|
177
|
+
const toolResult = await fn(args);
|
|
178
|
+
stepResults.push({ step: step.step, tool: step.tool, status: 'done', args, result: toolResult });
|
|
179
|
+
} else if (msg.content) {
|
|
180
|
+
stepResults.push({ step: step.step, tool: step.tool, status: 'done', note: 'Tool cagrilmadi, model dogrudan yanit verdi', content: msg.content.slice(0, 500) });
|
|
181
|
+
} else {
|
|
182
|
+
stepResults.push({ step: step.step, tool: step.tool, status: 'error', error: 'Tool cagrisi yapilmadi' });
|
|
183
|
+
failed = true;
|
|
184
|
+
}
|
|
185
|
+
} catch (e) {
|
|
186
|
+
stepResults.push({ step: step.step, tool: step.tool, status: 'error', error: e.message });
|
|
187
|
+
failed = true;
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
// Update workflow file
|
|
192
|
+
wfEntry.status = failed ? 'completed_with_errors' : 'completed';
|
|
193
|
+
wfEntry.completedAt = new Date().toISOString();
|
|
194
|
+
wfEntry.results = stepResults;
|
|
195
|
+
fs.writeFileSync(wfFile, JSON.stringify(wfEntry, null, 2));
|
|
196
|
+
|
|
197
|
+
// Save to history
|
|
198
|
+
ensureDir(path.dirname(WORKFLOW_HISTORY));
|
|
199
|
+
let history = [];
|
|
200
|
+
try { history = JSON.parse(fs.readFileSync(WORKFLOW_HISTORY, 'utf8')); } catch {}
|
|
201
|
+
history.unshift({ id: wfId, name: plan.workflowName || task.slice(0, 50), task, status: wfEntry.status, steps: plan.steps.length, completedAt: wfEntry.completedAt });
|
|
202
|
+
fs.writeFileSync(WORKFLOW_HISTORY, JSON.stringify(history.slice(0, 50), null, 2));
|
|
203
|
+
|
|
204
|
+
return {
|
|
205
|
+
success: true,
|
|
206
|
+
workflowId: wfId,
|
|
207
|
+
name: plan.workflowName || '',
|
|
208
|
+
description: plan.description || '',
|
|
209
|
+
totalSteps: plan.steps.length,
|
|
210
|
+
completedSteps: stepResults.filter(r => r.status === 'done').length,
|
|
211
|
+
failedSteps: stepResults.filter(r => r.status === 'error' || r.status === 'skipped').length,
|
|
212
|
+
status: wfEntry.status,
|
|
213
|
+
plan: plan.steps.map(s => ({ step: s.step, tool: s.tool, purpose: s.purpose })),
|
|
214
|
+
results: stepResults.map(r => ({
|
|
215
|
+
step: r.step, tool: r.tool, status: r.status,
|
|
216
|
+
result: r.status === 'done' ? r.result : undefined,
|
|
217
|
+
error: r.error, note: r.note,
|
|
218
|
+
})),
|
|
219
|
+
workflowFile: wfFile,
|
|
220
|
+
};
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
// ── PLAN_ONLY: Just generate the plan without executing ──────────────
|
|
224
|
+
if (action === 'plan') {
|
|
225
|
+
if (!task) return { success: false, error: 'task gerekli' };
|
|
226
|
+
const planPrompt = {
|
|
227
|
+
role: 'system',
|
|
228
|
+
content: 'Kullanilabilir tool\'lar:\n' + tools.map(t => '- ' + t).join('\n') +
|
|
229
|
+
'\n\nGorev icin bir workflow plani JSON formatinda olustur. JSON disinda hicbir sey yazma.\nFormat: { "workflowName": "...", "description": "...", "estimatedSteps": N, "steps": [{ "step": 1, "tool": "...", "purpose": "...", "params": {...}, "expectedOutput": "..." }] }'
|
|
230
|
+
};
|
|
231
|
+
const planBody = {
|
|
232
|
+
model, stream: false,
|
|
233
|
+
messages: [planPrompt, { role: 'user', content: 'Gorev: ' + task }],
|
|
234
|
+
temperature: 0.3, max_tokens: 4000,
|
|
235
|
+
};
|
|
236
|
+
try {
|
|
237
|
+
const result = await apiCall(providerUrl, providerApiKey, planBody);
|
|
238
|
+
const content = result.choices?.[0]?.message?.content || '';
|
|
239
|
+
const jsonMatch = content.match(/\{[\s\S]*\}/);
|
|
240
|
+
const plan = JSON.parse(jsonMatch ? jsonMatch[0] : content);
|
|
241
|
+
return { success: true, plan, raw: content.slice(0, 1000) };
|
|
242
|
+
} catch (e) {
|
|
243
|
+
return { success: false, error: 'Plan olusturulamadi: ' + e.message };
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
// ── SAVE / LOAD / LIST / DELETE ───────────────────────────────────────
|
|
248
|
+
if (action === 'save') {
|
|
249
|
+
if (!name || !steps) return { success: false, error: 'name ve steps gerekli' };
|
|
250
|
+
const wfId = 'wf_' + name.replace(/[^a-zA-Z0-9_-]/g, '_');
|
|
251
|
+
const wf = { id: wfId, name, description: params.description || '', steps, status: 'saved', createdAt: new Date().toISOString() };
|
|
252
|
+
fs.writeFileSync(path.join(WORKFLOW_DIR, wfId + '.json'), JSON.stringify(wf, null, 2));
|
|
253
|
+
return { success: true, workflowId: wfId, message: name + ' kaydedildi' };
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
if (action === 'load') {
|
|
257
|
+
const wfId = workflowId || name;
|
|
258
|
+
if (!wfId) return { success: false, error: 'workflowId gerekli' };
|
|
259
|
+
const wfFile = path.join(WORKFLOW_DIR, wfId + '.json');
|
|
260
|
+
if (!fs.existsSync(wfFile)) {
|
|
261
|
+
// Try to find by name
|
|
262
|
+
const files = fs.readdirSync(WORKFLOW_DIR).filter(f => f.endsWith('.json'));
|
|
263
|
+
for (const f of files) {
|
|
264
|
+
try {
|
|
265
|
+
const data = JSON.parse(fs.readFileSync(path.join(WORKFLOW_DIR, f), 'utf8'));
|
|
266
|
+
if (data.name === wfId || data.id === wfId) {
|
|
267
|
+
return { success: true, workflow: data };
|
|
268
|
+
}
|
|
269
|
+
} catch {}
|
|
270
|
+
}
|
|
271
|
+
return { success: false, error: 'Workflow bulunamadi: ' + wfId };
|
|
272
|
+
}
|
|
273
|
+
const data = JSON.parse(fs.readFileSync(wfFile, 'utf8'));
|
|
274
|
+
return { success: true, workflow: data };
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
if (action === 'list') {
|
|
278
|
+
const files = fs.readdirSync(WORKFLOW_DIR).filter(f => f.endsWith('.json'));
|
|
279
|
+
const list = files.map(f => {
|
|
280
|
+
try {
|
|
281
|
+
const data = JSON.parse(fs.readFileSync(path.join(WORKFLOW_DIR, f), 'utf8'));
|
|
282
|
+
return { id: data.id, name: data.name, status: data.status, steps: data.steps?.length || 0, createdAt: data.createdAt || data.startedAt };
|
|
283
|
+
} catch { return null; }
|
|
284
|
+
}).filter(Boolean);
|
|
285
|
+
return { success: true, workflows: list };
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
if (action === 'delete') {
|
|
289
|
+
const wfId = workflowId || name;
|
|
290
|
+
if (!wfId) return { success: false, error: 'workflowId gerekli' };
|
|
291
|
+
const wfFile = path.join(WORKFLOW_DIR, wfId + '.json');
|
|
292
|
+
if (fs.existsSync(wfFile)) fs.unlinkSync(wfFile);
|
|
293
|
+
return { success: true, message: wfId + ' silindi' };
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
// ── RETRY: Regenerate and rerun a specific step ──────────────────────
|
|
297
|
+
if (action === 'retry') {
|
|
298
|
+
const wfId = workflowId;
|
|
299
|
+
if (!wfId) return { success: false, error: 'workflowId gerekli' };
|
|
300
|
+
if (typeof regenerateStep !== 'number') return { success: false, error: 'regenerateStep (step numarasi) gerekli' };
|
|
301
|
+
const wfFile = path.join(WORKFLOW_DIR, wfId + '.json');
|
|
302
|
+
if (!fs.existsSync(wfFile)) return { success: false, error: 'Workflow bulunamadi: ' + wfId };
|
|
303
|
+
const wf = JSON.parse(fs.readFileSync(wfFile, 'utf8'));
|
|
304
|
+
const step = wf.steps?.find(s => s.step === regenerateStep);
|
|
305
|
+
if (!step) return { success: false, error: 'Adim bulunamadi: ' + regenerateStep };
|
|
306
|
+
step.params = params.newParams || step.params;
|
|
307
|
+
fs.writeFileSync(wfFile, JSON.stringify(wf, null, 2));
|
|
308
|
+
return { success: true, message: 'Adim ' + regenerateStep + ' yeniden calistirilmak uzere isaretlendi. Tekrar run yapin.', step };
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
return { success: false, error: 'Gecersiz action: ' + action + ' (run, plan, save, load, list, delete, retry)' };
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
module.exports = {
|
|
315
|
+
name: 'workflow',
|
|
316
|
+
description: '[ORCHESTRATOR] Cok adimli is akisi: gorev ver, AI en uygun tool\'lari secer ve sirayla calistirir. Plan/run/save/load/list/delete/retry.',
|
|
317
|
+
inputSchema: {
|
|
318
|
+
type: 'object',
|
|
319
|
+
properties: {
|
|
320
|
+
action: { type: 'string', description: 'run (tam otomatik), plan (sadece plan), save, load, list, delete, retry', enum: ['run', 'plan', 'save', 'load', 'list', 'delete', 'retry'] },
|
|
321
|
+
task: { type: 'string', description: '(run/plan) Yapilacak gorev — dogal dil ile anlat' },
|
|
322
|
+
steps: { type: 'array', description: '(save) Kaydedilecek adimlar', items: { type: 'object' } },
|
|
323
|
+
name: { type: 'string', description: '(save/load) Workflow adi' },
|
|
324
|
+
workflowId: { type: 'string', description: '(load/delete/retry) Workflow ID' },
|
|
325
|
+
regenerateStep: { type: 'number', description: '(retry) Yeniden calistirilacak adim numarasi' },
|
|
326
|
+
newParams: { type: 'object', description: '(retry) Yeni parametreler' },
|
|
327
|
+
description: { type: 'string', description: 'Aciklama' },
|
|
328
|
+
},
|
|
329
|
+
required: ['action'],
|
|
330
|
+
},
|
|
331
|
+
async execute(params) { return await workflow(params); },
|
|
332
|
+
};
|
|
@@ -55,6 +55,9 @@ function buildTiers(opts) {
|
|
|
55
55
|
|
|
56
56
|
// Tool rules (stable)
|
|
57
57
|
`ONEMLI: Tool cagirma SIMULE ETME. Sadece duz metin cevap ver. Islem yapmak gerekirse tool'u gercekten cagir.`,
|
|
58
|
+
`!!! ZORUNLU !!! HER istekte ILK OLARAK workflow(action="run", task="<kullanici mesaji>") cagir. workflow tool'u ne yapilacagini analiz eder, uygun tool'lari secer ve sirayla calistirir.`,
|
|
59
|
+
`workflow basit selamlasmalarda passthrough yapar, karmasik islerde adim adim plan+uygulama yapar.`,
|
|
60
|
+
`workflow'dan sonra ek tool cagirmaya GEREK YOK — workflow her seyi halleder.`,
|
|
58
61
|
`COK KRITIK: Goreve baslamadan ONCE <available_skills> listesini tara. Ilgili skill varsa skill_view(name) ile yukle, SONRA goreve basla.`,
|
|
59
62
|
`KRITIK: Skill yuklemeden islem yapma. Ilgili skill varsa once yukle.`,
|
|
60
63
|
`KRITIK: Kullanici kisisel bilgi verdiginde memory(action=add, target=user) ile kaydet.`,
|
package/src/utils/tools.js
CHANGED
|
@@ -66,6 +66,8 @@ const EMOJI_MAP = {
|
|
|
66
66
|
discord: '💬', send_message: '📨', async_delegation: '⏳', blueprint: '📐',
|
|
67
67
|
spotify: '🎧', homeassistant: '🏠', microsoft_graph: '📊', computer_use: '🖱️',
|
|
68
68
|
google_meet: '📹',
|
|
69
|
+
// Orchestrator
|
|
70
|
+
workflow: '⚙️',
|
|
69
71
|
};
|
|
70
72
|
|
|
71
73
|
// ── Toolset grouping ─────────────────────────────────────────────────────
|
|
@@ -117,7 +119,7 @@ const TOOLSET_MAP = {
|
|
|
117
119
|
clarify: 'agent',
|
|
118
120
|
session_search: 'memory',
|
|
119
121
|
x_search: 'web', discord: 'communication', send_message: 'communication',
|
|
120
|
-
async_delegation: 'agent', blueprint: 'planning',
|
|
122
|
+
async_delegation: 'agent', blueprint: 'planning', workflow: 'orchestrator',
|
|
121
123
|
spotify: 'media', homeassistant: 'iot', microsoft_graph: 'office',
|
|
122
124
|
computer_use: 'automation', google_meet: 'communication',
|
|
123
125
|
};
|