sam-coder-cli 2.0.0 → 2.0.2
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/agi-cli.js +23 -10
- package/package.json +1 -1
package/bin/agi-cli.js
CHANGED
|
@@ -1652,19 +1652,32 @@ async function chat(rl, mode, initialModel) {
|
|
|
1652
1652
|
// Fall through to normal processing if parsing/execution fails
|
|
1653
1653
|
}
|
|
1654
1654
|
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1655
|
+
try {
|
|
1656
|
+
const result = useToolCalling
|
|
1657
|
+
? await processQueryWithTools(input, conversation, currentModel)
|
|
1658
|
+
: await processQuery(input, conversation, currentModel);
|
|
1659
|
+
ui.stopThinking();
|
|
1660
|
+
ui.showResponse(result.response);
|
|
1660
1661
|
|
|
1661
|
-
|
|
1662
|
-
|
|
1662
|
+
conversation.length = 0;
|
|
1663
|
+
result.conversation.forEach(msg => conversation.push(msg));
|
|
1664
|
+
} catch (error) {
|
|
1665
|
+
ui.stopThinking();
|
|
1666
|
+
console.error('❌ Error processing request:', error.message);
|
|
1667
|
+
if (process.env.DEBUG) {
|
|
1668
|
+
console.error(error.stack);
|
|
1669
|
+
}
|
|
1670
|
+
}
|
|
1663
1671
|
|
|
1664
1672
|
rl.prompt();
|
|
1665
|
-
})
|
|
1666
|
-
|
|
1667
|
-
|
|
1673
|
+
});
|
|
1674
|
+
|
|
1675
|
+
// Return a Promise that resolves when readline closes
|
|
1676
|
+
return new Promise((resolve) => {
|
|
1677
|
+
rl.on('close', () => {
|
|
1678
|
+
ui.showResponse('Goodbye!');
|
|
1679
|
+
resolve();
|
|
1680
|
+
});
|
|
1668
1681
|
});
|
|
1669
1682
|
}
|
|
1670
1683
|
|
package/package.json
CHANGED