natureco-cli 2.23.0 → 2.23.1

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": "2.23.0",
3
+ "version": "2.23.1",
4
4
  "description": "NatureCo AI Bot Terminal Interface",
5
5
  "main": "bin/natureco.js",
6
6
  "bin": {
@@ -260,14 +260,14 @@ async function streamMessage(providerConfig, messages, tools) {
260
260
  if (tc.id != null) {
261
261
  toolCallsBuffer[idx].id = tc.id;
262
262
  }
263
+ // OpenAI format: tc.function.name / tc.function.arguments
263
264
  if (tc.function) {
264
- if (tc.function.name != null) {
265
- toolCallsBuffer[idx].name += tc.function.name;
266
- }
267
- if (tc.function.arguments != null) {
268
- toolCallsBuffer[idx].arguments += tc.function.arguments;
269
- }
265
+ if (tc.function.name != null) toolCallsBuffer[idx].name += tc.function.name;
266
+ if (tc.function.arguments != null) toolCallsBuffer[idx].arguments += tc.function.arguments;
270
267
  }
268
+ // Alternate format (llama-4-scout etc.): tc.name / tc.arguments directly
269
+ if (tc.name != null) toolCallsBuffer[idx].name += tc.name;
270
+ if (tc.arguments != null) toolCallsBuffer[idx].arguments += tc.arguments;
271
271
  }
272
272
  }
273
273
  } catch {}
@@ -702,15 +702,17 @@ ${indexPrompt}`;
702
702
 
703
703
  console.log(chalk.yellow(`\n🔧 ${streamResult.toolCalls.length} tool çalıştırılıyor...\n`));
704
704
 
705
- for (const toolCall of streamResult.toolCalls) {
705
+ for (let ti = 0; ti < streamResult.toolCalls.length; ti++) {
706
+ const toolCall = streamResult.toolCalls[ti];
706
707
  const result = await runToolCall(toolCall, stats);
707
708
  const resultStr = result.success !== false
708
709
  ? (result.output || JSON.stringify(result))
709
710
  : `Hata: ${result.error}`;
710
711
 
712
+ const matchedId = assistantMsg.tool_calls?.[ti]?.id || toolCall.id;
711
713
  conversationMessages.push({
712
714
  role: 'tool',
713
- tool_call_id: assistantMsg.tool_calls?.find(tc => tc.function.name === toolCall.name)?.id || toolCall.id,
715
+ tool_call_id: matchedId,
714
716
  name: toolCall.name,
715
717
  content: resultStr.slice(0, 3000),
716
718
  });
@@ -35,6 +35,7 @@ module.exports = {
35
35
 
36
36
  return {
37
37
  success: true,
38
+ output: `Dosya başarıyla yazıldı: ${filePath} (${stats.size} bytes)`,
38
39
  path: filePath,
39
40
  size: stats.size
40
41
  };