sam-coder-cli 2.0.1 → 2.0.3

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 +17 -3
  2. package/package.json +1 -1
package/bin/agi-cli.js CHANGED
@@ -1670,9 +1670,14 @@ async function chat(rl, mode, initialModel) {
1670
1670
  }
1671
1671
 
1672
1672
  rl.prompt();
1673
- }).on('close', () => {
1674
- ui.showResponse('Goodbye!');
1675
- 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
+ });
1676
1681
  });
1677
1682
  }
1678
1683
 
@@ -1789,6 +1794,7 @@ async function start() {
1789
1794
  ui.showResponse(`\nStarting in ${modeNames[selectedMode]} mode...\n`);
1790
1795
 
1791
1796
  await chat(rl, selectedMode, MODEL);
1797
+ process.exit(0);
1792
1798
  } catch (error) {
1793
1799
  ui.showError(error);
1794
1800
  rl.close();
@@ -1796,4 +1802,12 @@ async function start() {
1796
1802
  }
1797
1803
  }
1798
1804
 
1805
+ // Keep the process alive and handle uncaught errors
1806
+ process.on('uncaughtException', (err) => {
1807
+ console.error('Uncaught Exception:', err.message);
1808
+ });
1809
+ process.on('unhandledRejection', (reason) => {
1810
+ console.error('Unhandled Rejection:', reason);
1811
+ });
1812
+
1799
1813
  start().catch(console.error);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sam-coder-cli",
3
- "version": "2.0.1",
3
+ "version": "2.0.3",
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": {