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.
Files changed (2) hide show
  1. package/bin/agi-cli.js +23 -10
  2. 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
- const result = useToolCalling
1656
- ? await processQueryWithTools(input, conversation, currentModel)
1657
- : await processQuery(input, conversation, currentModel);
1658
- ui.stopThinking();
1659
- ui.showResponse(result.response);
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
- conversation.length = 0;
1662
- result.conversation.forEach(msg => conversation.push(msg));
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
- }).on('close', () => {
1666
- ui.showResponse('Goodbye!');
1667
- process.exit(0);
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sam-coder-cli",
3
- "version": "2.0.0",
3
+ "version": "2.0.2",
4
4
  "description": "SAM-CODER: An animated command-line AI assistant with agency capabilities, brainstorm framework, and engineer mode.",
5
5
  "main": "bin/agi-cli.js",
6
6
  "bin": {