sam-coder-cli 1.0.40 → 1.0.41
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/ai-team.js +13 -1
- package/bin/multiplayer-client.js +3 -4
- package/package.json +1 -1
package/bin/ai-team.js
CHANGED
|
@@ -5,6 +5,9 @@ const readline = require('readline');
|
|
|
5
5
|
const chalk = require('chalk');
|
|
6
6
|
const { v4: uuidv4 } = require('uuid');
|
|
7
7
|
|
|
8
|
+
// Flag to track if MultiplayerClient is being required to prevent infinite loops
|
|
9
|
+
let isRequiringMultiplayerClient = false;
|
|
10
|
+
|
|
8
11
|
// Lazy load dependencies to avoid circular dependencies
|
|
9
12
|
function getCallOpenRouter() {
|
|
10
13
|
if (!callOpenRouter) {
|
|
@@ -14,8 +17,17 @@ function getCallOpenRouter() {
|
|
|
14
17
|
}
|
|
15
18
|
|
|
16
19
|
function getMultiplayerClient() {
|
|
20
|
+
if (!MultiplayerClient && !isRequiringMultiplayerClient) {
|
|
21
|
+
try {
|
|
22
|
+
isRequiringMultiplayerClient = true;
|
|
23
|
+
const mc = require('./multiplayer-client');
|
|
24
|
+
MultiplayerClient = mc.MultiplayerClient;
|
|
25
|
+
} finally {
|
|
26
|
+
isRequiringMultiplayerClient = false;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
17
29
|
if (!MultiplayerClient) {
|
|
18
|
-
|
|
30
|
+
throw new Error('Failed to load MultiplayerClient');
|
|
19
31
|
}
|
|
20
32
|
return MultiplayerClient;
|
|
21
33
|
}
|
|
@@ -891,7 +891,6 @@ class MultiplayerClient extends EventEmitter {
|
|
|
891
891
|
}
|
|
892
892
|
}
|
|
893
893
|
|
|
894
|
-
module.exports
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
};
|
|
894
|
+
// Export MultiplayerClient and MultiplayerServer as direct properties of module.exports
|
|
895
|
+
module.exports.MultiplayerClient = MultiplayerClient;
|
|
896
|
+
module.exports.MultiplayerServer = MultiplayerServer;
|