natureco-cli 5.12.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "natureco-cli",
3
- "version": "5.12.0",
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"
@@ -70,6 +70,31 @@ async function workflow(params) {
70
70
  if (action === 'run') {
71
71
  if (!task) return { success: false, error: 'task gerekli' };
72
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
+
73
98
  // Phase 1: LLM plans the workflow
74
99
  const planPrompt = {
75
100
  role: 'system',
@@ -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.`,