natureco-cli 2.23.12 → 2.23.14

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 (2) hide show
  1. package/package.json +1 -1
  2. package/src/utils/api.js +14 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "natureco-cli",
3
- "version": "2.23.12",
3
+ "version": "2.23.14",
4
4
  "description": "NatureCo AI Bot Terminal Interface",
5
5
  "bin": {
6
6
  "natureco": "bin/natureco.js"
package/src/utils/api.js CHANGED
@@ -463,7 +463,16 @@ async function sendMessageOpenAICompatible(providerConfig, messages, tools) {
463
463
  }
464
464
 
465
465
  const data = await response.json();
466
- return data.choices[0].message;
466
+ console.error('DEBUG response:', JSON.stringify(data).slice(0, 200));
467
+ return {
468
+ role: 'assistant',
469
+ content: data.choices?.[0]?.message?.content
470
+ || data.choices?.[0]?.text
471
+ || data.response
472
+ || data.content
473
+ || '',
474
+ tool_calls: data.choices?.[0]?.message?.tool_calls || undefined,
475
+ };
467
476
  }
468
477
 
469
478
  /**
@@ -524,6 +533,7 @@ async function sendMessageAnthropic(providerConfig, messages, tools) {
524
533
  */
525
534
  async function sendMessageToProvider(apiKey, message, conversationId = null, systemPrompt = null, options = {}) {
526
535
  const providerConfig = getProviderConfig();
536
+ console.error('DEBUG sendMessageToProvider providerUrl:', providerConfig?.url);
527
537
 
528
538
  if (!providerConfig) {
529
539
  throw new Error(
@@ -722,6 +732,9 @@ function clearConversation(conversationId) {
722
732
  async function sendMessage(apiKey, botId, message, conversationId = null, chatSystemPrompt = '', options = {}) {
723
733
  // Handle legacy 6th param (toolDefinitions array was passed)
724
734
  if (Array.isArray(options)) options = {};
735
+ const providerConfig = getProviderConfig();
736
+ console.error('DEBUG providerUrl:', providerConfig?.url);
737
+ console.error('DEBUG provider type:', providerConfig?.isAnthropic ? 'anthropic' : 'openai');
725
738
  // Get user's home directory
726
739
  const homeDir = os.homedir();
727
740
 
@@ -731,7 +744,6 @@ async function sendMessage(apiKey, botId, message, conversationId = null, chatSy
731
744
 
732
745
  // Get config to check MCP status
733
746
  const config = getConfig();
734
- const providerConfig = getProviderConfig();
735
747
 
736
748
  // NatureCo — minimal system prompt, skip tool descriptions/MCP
737
749
  if (providerConfig && providerConfig.url.includes('api.natureco.me')) {