sam-coder-cli 1.0.37 → 1.0.38
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 +13 -8
- package/package.json +1 -1
package/bin/agi-cli.js
CHANGED
|
@@ -8,7 +8,7 @@ const fs = require('fs').promises;
|
|
|
8
8
|
const { exec } = require('child_process');
|
|
9
9
|
const util = require('util');
|
|
10
10
|
const execAsync = util.promisify(exec);
|
|
11
|
-
|
|
11
|
+
// Import MultiplayerMode only when needed to avoid circular dependencies
|
|
12
12
|
|
|
13
13
|
// Configuration
|
|
14
14
|
const CONFIG_PATH = path.join(os.homedir(), '.sam-coder-config.json');
|
|
@@ -800,14 +800,19 @@ async function start() {
|
|
|
800
800
|
console.log('3. Multiplayer Mode (collaborate with other agents)');
|
|
801
801
|
|
|
802
802
|
const mode = await askForMode(rl, true);
|
|
803
|
-
|
|
804
803
|
if (mode === 'multiplayer') {
|
|
805
|
-
const
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
804
|
+
const MultiplayerMode = require('./multiplayer-mode');
|
|
805
|
+
try {
|
|
806
|
+
const multiplayerMode = new MultiplayerMode({
|
|
807
|
+
rl,
|
|
808
|
+
model: MODEL,
|
|
809
|
+
serverUrl: process.env.MP_SERVER_URL || 'ws://localhost:8080'
|
|
810
|
+
});
|
|
811
|
+
await multiplayerMode.start();
|
|
812
|
+
} catch (error) {
|
|
813
|
+
console.error('Failed to initialize multiplayer mode:', error);
|
|
814
|
+
process.exit(1);
|
|
815
|
+
}
|
|
811
816
|
} else {
|
|
812
817
|
const useToolCalling = mode === 'tool';
|
|
813
818
|
ui.showResponse(`\nStarting in ${useToolCalling ? 'Tool Calling' : 'Function Calling'} mode...\n`);
|