node-mac-recorder 2.16.10 → 2.16.11

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.
Files changed (40) hide show
  1. package/.claude/settings.local.json +1 -1
  2. package/CLAUDE.md +51 -3
  3. package/package.json +1 -1
  4. package/src/mac_recorder.mm +49 -57
  5. package/bring-to-front-test.js +0 -159
  6. package/capture-test.js +0 -87
  7. package/cursor-test.js +0 -22
  8. package/debug-test.js +0 -95
  9. package/default-auto-front-test.js +0 -86
  10. package/final-multi-display-test.js +0 -74
  11. package/list-test.js +0 -46
  12. package/quick-cursor-test.js +0 -20
  13. package/quick-screen-test.js +0 -34
  14. package/quick-test.js +0 -35
  15. package/system-sound-test.js +0 -46
  16. package/test-audio-controls.js +0 -104
  17. package/test-both.js +0 -46
  18. package/test-console-logs.js +0 -81
  19. package/test-coordinate-debug.js +0 -25
  20. package/test-cursor-visible.js +0 -41
  21. package/test-electron-detection.js +0 -44
  22. package/test-final-coordinate-fix.js +0 -38
  23. package/test-hybrid.js +0 -53
  24. package/test-macos14-forced.js +0 -107
  25. package/test-macos14.js +0 -56
  26. package/test-multi-display-overlay.js +0 -185
  27. package/test-multi-screen-selection.js +0 -171
  28. package/test-multidisplay-fix.js +0 -120
  29. package/test-native-cursor.js +0 -31
  30. package/test-overlay-tracking.js +0 -175
  31. package/test-primary-live.js +0 -17
  32. package/test-primary-window-debug.js +0 -33
  33. package/test-quick.js +0 -55
  34. package/test-real-screen-ids.js +0 -32
  35. package/test-screencapture-only.js +0 -50
  36. package/test-screencapture-pure.js +0 -69
  37. package/test-screencapture.js +0 -52
  38. package/test-system-audio.js +0 -104
  39. package/test-window-selector-fix.js +0 -88
  40. package/window-selector-test.js +0 -160
@@ -1,171 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- const WindowSelector = require('./window-selector');
4
-
5
- async function testMultiScreenSelection() {
6
- console.log('🖥️ Multi-Screen Selection Test');
7
- console.log('==============================\n');
8
-
9
- const selector = new WindowSelector();
10
-
11
- try {
12
- // Check permissions first
13
- const permissions = await selector.checkPermissions();
14
- console.log('🔐 Permissions:');
15
- console.log(` Screen Recording: ${permissions.screenRecording ? '✅' : '❌'}`);
16
- console.log(` Accessibility: ${permissions.accessibility ? '✅' : '❌'}\n`);
17
-
18
- if (!permissions.screenRecording || !permissions.accessibility) {
19
- console.log('⚠️ Missing required permissions. Please grant permissions in System Preferences.');
20
- process.exit(1);
21
- }
22
-
23
- // Get display information
24
- const MacRecorder = require('./index');
25
- const recorder = new MacRecorder();
26
- const displays = await recorder.getDisplays();
27
-
28
- console.log(`🖥️ Found ${displays.length} display(s):`);
29
- displays.forEach((display, index) => {
30
- console.log(` Display ${index + 1}: ${display.name} (${display.resolution}) at (${display.x}, ${display.y}) ${display.isPrimary ? '🌟 PRIMARY' : ''}`);
31
- });
32
- console.log('');
33
-
34
- if (displays.length < 2) {
35
- console.log('⚠️ Only one display detected. Connect a second display to fully test multi-screen selection functionality.');
36
- console.log('Continuing with single display test...\n');
37
- } else {
38
- console.log('✅ Multiple displays detected. Perfect for multi-screen testing!\n');
39
- }
40
-
41
- console.log('🚀 Starting multi-screen selection test...\n');
42
- console.log('📋 What to expect:');
43
- console.log(' 1. Overlay will appear on ALL screens simultaneously');
44
- console.log(' 2. The screen where your mouse is located will be HIGHLIGHTED (brighter)');
45
- console.log(' 3. Other screens will be dimmer');
46
- console.log(' 4. Move mouse between screens to see the highlighting change');
47
- console.log(' 5. Click "Start Record" on the screen you want to record');
48
- console.log(' 6. Press ESC to cancel\n');
49
-
50
- if (displays.length > 1) {
51
- console.log('🖱️ Multi-Screen Instructions:');
52
- console.log(' • Move your mouse from one screen to another');
53
- console.log(' • Watch the overlay highlighting follow your mouse');
54
- console.log(' • Notice how the active screen becomes brighter');
55
- console.log(' • All screens should show the overlay simultaneously\n');
56
- }
57
-
58
- console.log('⏱️ Starting screen selection in 3 seconds...');
59
- await new Promise(resolve => setTimeout(resolve, 3000));
60
-
61
- // Start screen selection
62
- const success = await selector.startScreenSelection();
63
-
64
- if (!success) {
65
- console.error('❌ Failed to start screen selection');
66
- process.exit(1);
67
- }
68
-
69
- console.log('✅ Screen selection started successfully!');
70
- console.log('🖱️ Move your mouse between screens to test highlighting...\n');
71
-
72
- // Monitor for selection completion
73
- let checkCount = 0;
74
- const selectionChecker = setInterval(() => {
75
- checkCount++;
76
- const selectedScreen = selector.getSelectedScreen();
77
-
78
- if (selectedScreen) {
79
- clearInterval(selectionChecker);
80
-
81
- console.log('\n' + '🎉'.repeat(25));
82
- console.log('🎯 SCREEN SELECTED!');
83
- console.log('🎉'.repeat(25));
84
-
85
- console.log(`\n📊 Selected Screen Details:`);
86
- console.log(` Name: ${selectedScreen.name}`);
87
- console.log(` Resolution: ${selectedScreen.resolution}`);
88
- console.log(` Position: (${selectedScreen.x}, ${selectedScreen.y})`);
89
- console.log(` Size: ${selectedScreen.width} × ${selectedScreen.height}`);
90
- console.log(` Primary: ${selectedScreen.isPrimary ? 'Yes' : 'No'}`);
91
-
92
- console.log(`\n✅ Multi-screen selection test completed successfully!`);
93
- console.log(`📈 Test ran for ${(checkCount * 100) / 1000} seconds`);
94
-
95
- process.exit(0);
96
- }
97
-
98
- // Show progress every 5 seconds
99
- if (checkCount % 50 === 0) {
100
- const elapsed = (checkCount * 100) / 1000;
101
- console.log(`⏱️ Test running for ${elapsed}s - Move mouse between screens to test highlighting`);
102
-
103
- if (displays.length > 1) {
104
- console.log('💡 Remember: The overlay should appear on ALL screens, but only the one with your mouse should be bright');
105
- }
106
- }
107
- }, 100); // Check every 100ms
108
-
109
- // Timeout after 60 seconds
110
- setTimeout(() => {
111
- clearInterval(selectionChecker);
112
- console.log('\n⏰ Test timeout reached (60 seconds)');
113
- console.log('🛑 Stopping screen selection...');
114
-
115
- selector.stopScreenSelection().then(() => {
116
- console.log('✅ Screen selection stopped');
117
-
118
- if (displays.length > 1) {
119
- console.log('\n📊 Multi-Screen Test Summary:');
120
- console.log(' Expected behavior:');
121
- console.log(' ✓ Overlays should have appeared on all screens');
122
- console.log(' ✓ Mouse screen should have been highlighted brighter');
123
- console.log(' ✓ Non-mouse screens should have been dimmer');
124
- console.log(' ✓ Highlighting should have changed as you moved mouse');
125
- } else {
126
- console.log('\n📊 Single-Screen Test Summary:');
127
- console.log(' ✓ Overlay should have appeared on your screen');
128
- console.log(' ✓ Screen should have been highlighted');
129
- }
130
-
131
- process.exit(0);
132
- }).catch((error) => {
133
- console.error('❌ Error stopping screen selection:', error.message);
134
- process.exit(1);
135
- });
136
- }, 60000);
137
-
138
- // Handle Ctrl+C gracefully
139
- process.on('SIGINT', async () => {
140
- clearInterval(selectionChecker);
141
- console.log('\n\n🛑 Test interrupted by user');
142
-
143
- try {
144
- await selector.stopScreenSelection();
145
- console.log('✅ Screen selection stopped');
146
- } catch (error) {
147
- console.log('⚠️ Error during cleanup:', error.message);
148
- }
149
-
150
- console.log('\n📊 Test Results Summary:');
151
- console.log(` Displays available: ${displays.length}`);
152
- console.log(` Test duration: ${(checkCount * 100) / 1000} seconds`);
153
- if (displays.length > 1) {
154
- console.log(' Multi-screen support: Test interrupted before completion');
155
- }
156
-
157
- process.exit(0);
158
- });
159
-
160
- } catch (error) {
161
- console.error('\n❌ Test failed:', error.message);
162
- if (error.stack) {
163
- console.error('Stack trace:', error.stack);
164
- }
165
- process.exit(1);
166
- }
167
- }
168
-
169
- if (require.main === module) {
170
- testMultiScreenSelection();
171
- }
@@ -1,120 +0,0 @@
1
- const MacRecorder = require('./index');
2
- const WindowSelector = MacRecorder.WindowSelector;
3
-
4
- console.log('🧪 Testing multi-display fixes...');
5
-
6
- async function testDisplaySelection() {
7
- console.log('\n🖥️ Testing display selection:');
8
-
9
- const recorder = new MacRecorder();
10
- const displays = await recorder.getDisplays();
11
-
12
- console.log(`Found ${displays.length} displays:`);
13
- displays.forEach((display, index) => {
14
- console.log(` ${index + 1}. ${display.name} (ID: ${display.id}) - ${display.resolution} at (${display.x}, ${display.y}) ${display.isPrimary ? '[PRIMARY]' : ''}`);
15
- });
16
-
17
- // Test recording on each display
18
- for (const display of displays) {
19
- console.log(`\n📹 Testing recording on ${display.name}:`);
20
- try {
21
- const outputPath = `./test-output/display-${display.id}-test.mov`;
22
-
23
- await recorder.startRecording(outputPath, {
24
- displayId: display.id,
25
- captureCursor: false,
26
- includeMicrophone: false,
27
- includeSystemAudio: false
28
- });
29
-
30
- console.log(`✅ Recording started on ${display.name}`);
31
-
32
- // Record for 2 seconds
33
- await new Promise(resolve => setTimeout(resolve, 2000));
34
-
35
- await recorder.stopRecording();
36
- console.log(`✅ Recording stopped on ${display.name}`);
37
-
38
- } catch (error) {
39
- console.log(`❌ Recording failed on ${display.name}: ${error.message}`);
40
- }
41
-
42
- // Small delay between tests
43
- await new Promise(resolve => setTimeout(resolve, 1000));
44
- }
45
- }
46
-
47
- async function testScreenSelector() {
48
- console.log('\n🎯 Testing screen selector multi-display...');
49
-
50
- const selector = new WindowSelector();
51
-
52
- try {
53
- console.log('🔍 Starting screen selection... (This should show overlays on ALL displays)');
54
- await selector.startScreenSelection();
55
-
56
- console.log('⏱️ Screen selection UI is running...');
57
- console.log(' - Check if overlays appear on ALL displays');
58
- console.log(' - Check if buttons and text are positioned correctly');
59
- console.log(' - Check if app icons are visible and animated');
60
-
61
- // Let it run for 10 seconds for manual inspection
62
- await new Promise(resolve => setTimeout(resolve, 10000));
63
-
64
- console.log('🛑 Stopping screen selection...');
65
- await selector.stopScreenSelection();
66
-
67
- } catch (error) {
68
- console.log(`❌ Screen selector test failed: ${error.message}`);
69
- }
70
- }
71
-
72
- async function testWindowSelector() {
73
- console.log('\n🪟 Testing window selector multi-display...');
74
-
75
- const selector = new WindowSelector();
76
-
77
- try {
78
- console.log('🔍 Starting window selection... (This should work across ALL displays)');
79
- await selector.startSelection();
80
-
81
- console.log('⏱️ Window selection UI is running...');
82
- console.log(' - Move cursor to windows on different displays');
83
- console.log(' - Check if highlighting works properly');
84
- console.log(' - Check if buttons appear correctly over highlighted windows');
85
-
86
- // Let it run for 15 seconds for manual inspection
87
- await new Promise(resolve => setTimeout(resolve, 15000));
88
-
89
- console.log('🛑 Stopping window selection...');
90
- await selector.stopSelection();
91
-
92
- } catch (error) {
93
- console.log(`❌ Window selector test failed: ${error.message}`);
94
- }
95
- }
96
-
97
- async function runTests() {
98
- try {
99
- // Check permissions first
100
- const recorder = new MacRecorder();
101
- const permissions = await recorder.checkPermissions();
102
-
103
- if (!permissions.screenRecording) {
104
- console.log('❌ Screen recording permission required. Enable in System Preferences > Security & Privacy > Privacy > Screen Recording');
105
- return;
106
- }
107
-
108
- await testDisplaySelection();
109
- await testScreenSelector();
110
- await testWindowSelector();
111
-
112
- console.log('\n🎉 Multi-display tests completed!');
113
-
114
- } catch (error) {
115
- console.log(`❌ Test suite failed: ${error.message}`);
116
- console.log(error.stack);
117
- }
118
- }
119
-
120
- runTests();
@@ -1,31 +0,0 @@
1
- const nativeBinding = require('./build/Release/mac_recorder.node');
2
-
3
- console.log('Testing native cursor tracking...');
4
-
5
- // Test native startCursorTracking function directly
6
- const testFile = 'native-cursor-test.json';
7
- const started = nativeBinding.startCursorTracking(testFile);
8
-
9
- console.log('Native tracking started:', started);
10
-
11
- if (started) {
12
- setTimeout(() => {
13
- const stopped = nativeBinding.stopCursorTracking();
14
- console.log('Native tracking stopped:', stopped);
15
-
16
- const fs = require('fs');
17
- if (fs.existsSync(testFile)) {
18
- const content = fs.readFileSync(testFile, 'utf8');
19
- console.log('\nNative output:');
20
- try {
21
- const data = JSON.parse(content);
22
- console.log(JSON.stringify(data.slice(0, 3), null, 2)); // Show first 3 entries
23
- console.log('Total entries:', data.length);
24
- } catch (e) {
25
- console.log('Raw content:', content.substring(0, 500));
26
- }
27
- }
28
- }, 2000);
29
- } else {
30
- console.log('Failed to start native tracking');
31
- }
@@ -1,175 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- /**
4
- * Test script to analyze overlay tracking issues during window movement
5
- */
6
-
7
- const WindowSelector = require('./window-selector');
8
-
9
- async function testOverlayTracking() {
10
- console.log('🔬 OVERLAY TRACKING ANALYSIS');
11
- console.log('=============================\n');
12
-
13
- const selector = new WindowSelector();
14
-
15
- try {
16
- // Track mouse vs overlay position data
17
- let mousePositions = [];
18
- let overlayUpdates = [];
19
- let windowMovements = [];
20
-
21
- selector.on('windowEntered', (window) => {
22
- const timestamp = Date.now();
23
- overlayUpdates.push({
24
- timestamp,
25
- type: 'entered',
26
- window: {
27
- id: window.id,
28
- title: window.title,
29
- appName: window.appName,
30
- x: window.x,
31
- y: window.y,
32
- width: window.width,
33
- height: window.height
34
- }
35
- });
36
-
37
- console.log(`🏠 [${new Date(timestamp).toISOString().substr(11,12)}] ENTERED: "${window.title}" at (${window.x}, ${window.y}) ${window.width}×${window.height}`);
38
- });
39
-
40
- selector.on('windowLeft', (window) => {
41
- const timestamp = Date.now();
42
- overlayUpdates.push({
43
- timestamp,
44
- type: 'left',
45
- window: {
46
- id: window.id,
47
- title: window.title,
48
- x: window.x,
49
- y: window.y
50
- }
51
- });
52
-
53
- console.log(`🚪 [${new Date(timestamp).toISOString().substr(11,12)}] LEFT: "${window.title}" from (${window.x}, ${window.y})`);
54
- });
55
-
56
- console.log('🎯 Starting window selection...');
57
- console.log('📍 Move your cursor over windows and drag them around');
58
- console.log('⏰ Test will run for 30 seconds\n');
59
-
60
- await selector.startSelection();
61
-
62
- // Periodically log mouse position and compare with overlay state
63
- const trackingInterval = setInterval(async () => {
64
- try {
65
- const status = selector.getStatus();
66
- const timestamp = Date.now();
67
-
68
- if (status.nativeStatus?.currentWindow) {
69
- const window = status.nativeStatus.currentWindow;
70
- mousePositions.push({
71
- timestamp,
72
- windowId: window.id,
73
- windowPos: { x: window.x, y: window.y },
74
- windowSize: { width: window.width, height: window.height }
75
- });
76
-
77
- // Check for window movement by comparing with previous position
78
- const prevPos = mousePositions.find(p =>
79
- p.windowId === window.id &&
80
- p.timestamp < timestamp - 100 && // at least 100ms ago
81
- (p.windowPos.x !== window.x || p.windowPos.y !== window.y)
82
- );
83
-
84
- if (prevPos) {
85
- windowMovements.push({
86
- timestamp,
87
- windowId: window.id,
88
- title: window.title,
89
- from: prevPos.windowPos,
90
- to: { x: window.x, y: window.y },
91
- deltaX: window.x - prevPos.windowPos.x,
92
- deltaY: window.y - prevPos.windowPos.y
93
- });
94
-
95
- console.log(`📍 [${new Date(timestamp).toISOString().substr(11,12)}] MOVED: "${window.title}" (${prevPos.windowPos.x}, ${prevPos.windowPos.y}) → (${window.x}, ${window.y}) Δ(${window.x - prevPos.windowPos.x}, ${window.y - prevPos.windowPos.y})`);
96
- }
97
- }
98
- } catch (err) {
99
- // Ignore errors during status check
100
- }
101
- }, 50); // Check every 50ms for high resolution tracking
102
-
103
- // Run test for 30 seconds
104
- await new Promise(resolve => setTimeout(resolve, 30000));
105
-
106
- clearInterval(trackingInterval);
107
- console.log('\n⏹️ Test completed. Analyzing data...\n');
108
-
109
- // Analysis
110
- console.log('📊 ANALYSIS RESULTS:');
111
- console.log('====================\n');
112
-
113
- console.log(`📝 Total overlay updates: ${overlayUpdates.length}`);
114
- console.log(`📝 Total mouse position samples: ${mousePositions.length}`);
115
- console.log(`📝 Detected window movements: ${windowMovements.length}\n`);
116
-
117
- // Analyze window movement patterns
118
- if (windowMovements.length > 0) {
119
- console.log('🔍 WINDOW MOVEMENT PATTERNS:');
120
-
121
- const movementsByWindow = {};
122
- windowMovements.forEach(move => {
123
- if (!movementsByWindow[move.windowId]) {
124
- movementsByWindow[move.windowId] = [];
125
- }
126
- movementsByWindow[move.windowId].push(move);
127
- });
128
-
129
- for (const [windowId, moves] of Object.entries(movementsByWindow)) {
130
- const firstMove = moves[0];
131
- const lastMove = moves[moves.length - 1];
132
- const totalDeltaX = Math.abs(lastMove.to.x - firstMove.from.x);
133
- const totalDeltaY = Math.abs(lastMove.to.y - firstMove.from.y);
134
- const duration = lastMove.timestamp - firstMove.timestamp;
135
-
136
- console.log(` Window "${firstMove.title}" (ID: ${windowId}):`);
137
- console.log(` Movements: ${moves.length}`);
138
- console.log(` Total displacement: (${totalDeltaX}, ${totalDeltaY}) pixels`);
139
- console.log(` Duration: ${duration}ms`);
140
- console.log(` Average speed: ${(Math.sqrt(totalDeltaX*totalDeltaX + totalDeltaY*totalDeltaY) / (duration/1000)).toFixed(1)} px/sec\n`);
141
- }
142
- }
143
-
144
- // Analyze update frequency
145
- if (overlayUpdates.length > 1) {
146
- console.log('⏱️ OVERLAY UPDATE TIMING:');
147
- const intervals = [];
148
- for (let i = 1; i < overlayUpdates.length; i++) {
149
- intervals.push(overlayUpdates[i].timestamp - overlayUpdates[i-1].timestamp);
150
- }
151
-
152
- if (intervals.length > 0) {
153
- const avgInterval = intervals.reduce((a, b) => a + b, 0) / intervals.length;
154
- const minInterval = Math.min(...intervals);
155
- const maxInterval = Math.max(...intervals);
156
-
157
- console.log(` Average update interval: ${avgInterval.toFixed(1)}ms (${(1000/avgInterval).toFixed(1)} FPS)`);
158
- console.log(` Min interval: ${minInterval}ms`);
159
- console.log(` Max interval: ${maxInterval}ms\n`);
160
- }
161
- }
162
-
163
- } catch (error) {
164
- console.error('❌ Test failed:', error.message);
165
- } finally {
166
- console.log('🛑 Cleaning up...');
167
- await selector.cleanup();
168
- }
169
- }
170
-
171
- if (require.main === module) {
172
- testOverlayTracking().catch(console.error);
173
- }
174
-
175
- module.exports = testOverlayTracking;
@@ -1,17 +0,0 @@
1
- const MacRecorder = require('./index');
2
- const WindowSelector = MacRecorder.WindowSelector;
3
-
4
- console.log('🔥 LIVE Primary Display Test - Move cursor NOW!');
5
- console.log(' - Quickly move to primary display windows');
6
- console.log(' - Look for [PRIMARY] tags in logs');
7
-
8
- const selector = new WindowSelector();
9
-
10
- selector.startSelection().then(() => {
11
- // Auto-stop after 8 seconds
12
- setTimeout(() => {
13
- selector.stopSelection().then(() => {
14
- process.exit(0);
15
- });
16
- }, 8000);
17
- });
@@ -1,33 +0,0 @@
1
- const MacRecorder = require('./index');
2
- const WindowSelector = MacRecorder.WindowSelector;
3
-
4
- async function testPrimaryWindowDebug() {
5
- console.log('🔍 Testing PRIMARY display window debugging...');
6
-
7
- const recorder = new MacRecorder();
8
- const displays = await recorder.getDisplays();
9
-
10
- const primary = displays.find(d => d.isPrimary);
11
- console.log(`Primary display: ${primary.name} at (${primary.x}, ${primary.y}) ${primary.width}x${primary.height}`);
12
-
13
- const selector = new WindowSelector();
14
-
15
- try {
16
- console.log('🚀 Starting window selection...');
17
- console.log('📍 IMPORTANT: Move cursor to a window ON THE PRIMARY DISPLAY');
18
- console.log(' - Look for windows at coordinates like (0, 50) or (100, 100)');
19
- console.log(' - Should see GlobalOffset: (3440, 56) for primary display');
20
-
21
- await selector.startSelection();
22
-
23
- // Let it run for 15 seconds to catch primary display windows
24
- await new Promise(resolve => setTimeout(resolve, 15000));
25
-
26
- await selector.stopSelection();
27
-
28
- } catch (error) {
29
- console.log(`❌ Test failed: ${error.message}`);
30
- }
31
- }
32
-
33
- testPrimaryWindowDebug();
package/test-quick.js DELETED
@@ -1,55 +0,0 @@
1
- const MacRecorder = require('./index');
2
-
3
- // Test video creation in Node.js
4
- // process.env.ELECTRON_RUN_AS_NODE = '1';
5
-
6
- console.log('🎯 Quick ScreenCaptureKit Test');
7
-
8
- async function quickTest() {
9
- const recorder = new MacRecorder();
10
-
11
- try {
12
- const outputPath = './test-output/quick-test.mov';
13
-
14
- console.log('📹 Starting recording...');
15
- const result = await recorder.startRecording(outputPath, {
16
- captureCursor: true,
17
- includeMicrophone: false,
18
- includeSystemAudio: false
19
- });
20
-
21
- if (result) {
22
- console.log('✅ Recording started successfully');
23
-
24
- // Record for only 3 seconds
25
- console.log('⏱️ Recording for 3 seconds...');
26
- await new Promise(resolve => setTimeout(resolve, 3000));
27
-
28
- console.log('🛑 Stopping recording...');
29
- await recorder.stopRecording();
30
-
31
- // Check if file exists and has content
32
- const fs = require('fs');
33
- setTimeout(() => {
34
- if (fs.existsSync(outputPath)) {
35
- const stats = fs.statSync(outputPath);
36
- console.log(`✅ Video file: ${outputPath} (${stats.size} bytes)`);
37
-
38
- if (stats.size > 1000) {
39
- console.log('🎉 SUCCESS! ScreenCaptureKit is working!');
40
- } else {
41
- console.log('⚠️ File too small');
42
- }
43
- } else {
44
- console.log('❌ No output file');
45
- }
46
- }, 2000);
47
- } else {
48
- console.log('❌ Failed to start recording');
49
- }
50
- } catch (error) {
51
- console.log('❌ Error:', error.message);
52
- }
53
- }
54
-
55
- quickTest().catch(console.error);
@@ -1,32 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- const WindowSelector = require('./window-selector');
4
-
5
- async function testRealScreenIDs() {
6
- console.log('Testing real screen ID generation...\n');
7
-
8
- const selector = new WindowSelector();
9
-
10
- // Start screen selection to generate screen info
11
- console.log('Starting screen selection (will timeout in 3 seconds)...');
12
-
13
- const startPromise = selector.startScreenSelection();
14
-
15
- // Wait a bit for screen info to be generated
16
- await new Promise(resolve => setTimeout(resolve, 1000));
17
-
18
- // Try to get selected screen info (should be null since nothing selected)
19
- const selectedInfo = selector.getSelectedScreen();
20
- console.log('Selected screen info (should be null):', selectedInfo);
21
-
22
- // Clean up
23
- try {
24
- await selector.stopScreenSelection();
25
- } catch (e) {
26
- // Ignore
27
- }
28
-
29
- console.log('\nTest completed. Check logs above for screen creation details.');
30
- }
31
-
32
- testRealScreenIDs().catch(console.error);