genbox 1.0.160 → 1.0.161
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/dist/commands/attach.js +29 -11
- package/package.json +1 -1
package/dist/commands/attach.js
CHANGED
|
@@ -469,17 +469,18 @@ async function attachToSession(ipAddress, keyPath, sessionName, genboxName) {
|
|
|
469
469
|
return;
|
|
470
470
|
}
|
|
471
471
|
lastClipboard = currentClipboard;
|
|
472
|
-
// Debug: show that we detected a clipboard change (only if it looks like a path)
|
|
473
|
-
if (currentClipboard.includes('/Users/') || currentClipboard.includes('/var/') || currentClipboard.includes('/tmp/')) {
|
|
474
|
-
process.stderr.write(`\n${chalk_1.default.dim('📋 Clipboard changed, checking for image path...')}\n`);
|
|
475
|
-
}
|
|
476
472
|
// Try to extract a local image path
|
|
477
473
|
const extractResult = extractLocalImagePath(currentClipboard);
|
|
478
474
|
// If file path was detected but file doesn't exist (e.g., macOS temp file was cleaned up)
|
|
479
475
|
if (extractResult.notFound) {
|
|
480
476
|
const fileName = path.basename(extractResult.notFound);
|
|
481
|
-
|
|
482
|
-
|
|
477
|
+
// Use macOS notification since tmux obscures stderr
|
|
478
|
+
if (os.platform() === 'darwin') {
|
|
479
|
+
try {
|
|
480
|
+
(0, child_process_1.execSync)(`osascript -e 'display notification "File not found: ${fileName.replace(/'/g, "\\'")}" with title "Genbox" sound name "Basso"'`, { stdio: 'ignore' });
|
|
481
|
+
}
|
|
482
|
+
catch { }
|
|
483
|
+
}
|
|
483
484
|
return;
|
|
484
485
|
}
|
|
485
486
|
if (!extractResult.path) {
|
|
@@ -490,19 +491,36 @@ async function attachToSession(ipAddress, keyPath, sessionName, genboxName) {
|
|
|
490
491
|
if (uploadedPaths.has(localPath)) {
|
|
491
492
|
return;
|
|
492
493
|
}
|
|
493
|
-
// Show
|
|
494
|
-
|
|
494
|
+
// Show uploading notification
|
|
495
|
+
const fileName = path.basename(localPath);
|
|
496
|
+
if (os.platform() === 'darwin') {
|
|
497
|
+
try {
|
|
498
|
+
(0, child_process_1.execSync)(`osascript -e 'display notification "Uploading ${fileName.replace(/'/g, "\\'").substring(0, 50)}..." with title "Genbox"'`, { stdio: 'ignore' });
|
|
499
|
+
}
|
|
500
|
+
catch { }
|
|
501
|
+
}
|
|
495
502
|
// Upload the file (this happens in background, might cause brief pause)
|
|
496
503
|
const result = uploadFileSync(localPath, ipAddress, keyPath);
|
|
497
504
|
if (result.success) {
|
|
498
505
|
uploadedPaths.add(localPath);
|
|
499
506
|
// Replace clipboard with remote path
|
|
500
507
|
setClipboard(result.remotePath);
|
|
501
|
-
// Use
|
|
502
|
-
|
|
508
|
+
// Use macOS notification since tmux obscures stderr
|
|
509
|
+
if (os.platform() === 'darwin') {
|
|
510
|
+
try {
|
|
511
|
+
(0, child_process_1.execSync)(`osascript -e 'display notification "Clipboard now has remote path. Cmd+V to paste!" with title "✓ Image Uploaded" sound name "Glass"'`, { stdio: 'ignore' });
|
|
512
|
+
}
|
|
513
|
+
catch { }
|
|
514
|
+
}
|
|
503
515
|
}
|
|
504
516
|
else {
|
|
505
|
-
|
|
517
|
+
// Notification for failure
|
|
518
|
+
if (os.platform() === 'darwin') {
|
|
519
|
+
try {
|
|
520
|
+
(0, child_process_1.execSync)(`osascript -e 'display notification "Upload failed: ${(result.error || 'unknown').replace(/'/g, "\\'")}" with title "Genbox" sound name "Basso"'`, { stdio: 'ignore' });
|
|
521
|
+
}
|
|
522
|
+
catch { }
|
|
523
|
+
}
|
|
506
524
|
}
|
|
507
525
|
}
|
|
508
526
|
catch {
|