sam-coder-cli 1.0.37 → 1.0.39
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/bin/ai-team.js +18 -2
- 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`);
|
package/bin/ai-team.js
CHANGED
|
@@ -1,9 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
// Import dependencies at runtime to avoid circular dependencies
|
|
2
|
+
let callOpenRouter;
|
|
3
|
+
let MultiplayerClient;
|
|
3
4
|
const readline = require('readline');
|
|
4
5
|
const chalk = require('chalk');
|
|
5
6
|
const { v4: uuidv4 } = require('uuid');
|
|
6
7
|
|
|
8
|
+
// Lazy load dependencies to avoid circular dependencies
|
|
9
|
+
function getCallOpenRouter() {
|
|
10
|
+
if (!callOpenRouter) {
|
|
11
|
+
callOpenRouter = require('./agi-cli').callOpenRouter;
|
|
12
|
+
}
|
|
13
|
+
return callOpenRouter;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
function getMultiplayerClient() {
|
|
17
|
+
if (!MultiplayerClient) {
|
|
18
|
+
MultiplayerClient = require('./multiplayer-client').MultiplayerClient;
|
|
19
|
+
}
|
|
20
|
+
return MultiplayerClient;
|
|
21
|
+
}
|
|
22
|
+
|
|
7
23
|
// System prompt for AI team collaboration
|
|
8
24
|
const TEAM_COLLABORATION_PROMPT = `You are an AI team facilitator that helps coordinate multiple AI agents working together on a project.
|
|
9
25
|
|