shell-mirror 1.5.93 → 1.5.94
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/mac-agent/agent.js +8 -1
- package/package.json +1 -1
package/mac-agent/agent.js
CHANGED
|
@@ -31,7 +31,14 @@ try {
|
|
|
31
31
|
process.exit(1);
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
|
|
34
|
+
// Generate stable agent ID from machine identity (prevents duplicate registrations)
|
|
35
|
+
function generateStableAgentId() {
|
|
36
|
+
const hostname = os.hostname();
|
|
37
|
+
const username = os.userInfo().username;
|
|
38
|
+
return `mac-${username}-${hostname}`.replace(/[^a-zA-Z0-9-]/g, '-');
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const AGENT_ID = process.env.AGENT_ID || generateStableAgentId();
|
|
35
42
|
logToFile(`🆔 Agent ID: ${AGENT_ID}`);
|
|
36
43
|
|
|
37
44
|
// Determine signaling server URL - prefer WEBSOCKET_URL for cloud connections
|
package/package.json
CHANGED