vibex-sh 0.2.2 → 0.2.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.
- package/index.js +12 -14
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -399,15 +399,8 @@ async function main() {
|
|
|
399
399
|
console.log(' 💡 Tip: Use -s to send more logs to this session');
|
|
400
400
|
console.log(` Example: echo '{"cpu": 45, "memory": 78}' | npx vibex-sh -s ${sessionSlug}${localFlag}\n`);
|
|
401
401
|
} else {
|
|
402
|
-
// When reusing a session, show minimal info
|
|
403
|
-
|
|
404
|
-
? `${webUrl}/${sessionId}?auth=${authCode}`
|
|
405
|
-
: `${webUrl}/${sessionId}`;
|
|
406
|
-
console.log(` 🔍 Sending logs to session: ${sessionId}`);
|
|
407
|
-
if (authCode) {
|
|
408
|
-
console.log(` Auth Code: ${authCode}`);
|
|
409
|
-
}
|
|
410
|
-
console.log(` Dashboard: ${dashboardUrl}\n`);
|
|
402
|
+
// When reusing a session, show minimal info (no auth code)
|
|
403
|
+
console.log(` 🔍 Sending logs to session: ${sessionId}\n`);
|
|
411
404
|
}
|
|
412
405
|
|
|
413
406
|
const socket = io(socketUrl, {
|
|
@@ -427,6 +420,9 @@ async function main() {
|
|
|
427
420
|
|
|
428
421
|
// Store auth code received from socket
|
|
429
422
|
let receivedAuthCode = authCode;
|
|
423
|
+
|
|
424
|
+
// Track if this is a new session (not reusing an existing one)
|
|
425
|
+
const isNewSession = !options.sessionId;
|
|
430
426
|
|
|
431
427
|
socket.on('connect', () => {
|
|
432
428
|
isConnected = true;
|
|
@@ -453,15 +449,17 @@ async function main() {
|
|
|
453
449
|
});
|
|
454
450
|
|
|
455
451
|
// Listen for auth code from socket.io (for unclaimed sessions)
|
|
452
|
+
// Only display auth code if this is a new session (not when reusing existing session)
|
|
456
453
|
socket.on('session-auth-code', (data) => {
|
|
457
454
|
if (data.sessionId === sessionId && data.authCode) {
|
|
458
|
-
//
|
|
459
|
-
// This ensures we show it even if we didn't get it from claimSession
|
|
455
|
+
// Update received auth code
|
|
460
456
|
if (!receivedAuthCode || receivedAuthCode !== data.authCode) {
|
|
461
457
|
receivedAuthCode = data.authCode;
|
|
462
|
-
//
|
|
463
|
-
|
|
464
|
-
|
|
458
|
+
// Only display auth code for new sessions, not when reusing existing sessions
|
|
459
|
+
if (isNewSession) {
|
|
460
|
+
console.log(` 🔑 Auth Code: ${receivedAuthCode}`);
|
|
461
|
+
console.log(` 📋 Dashboard: ${webUrl}/${sessionId}?auth=${receivedAuthCode}\n`);
|
|
462
|
+
}
|
|
465
463
|
}
|
|
466
464
|
}
|
|
467
465
|
});
|