@myerscarpenter/quest-dev 1.0.8 → 1.2.0
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/build/commands/battery.d.ts +9 -0
- package/build/commands/battery.d.ts.map +1 -0
- package/build/commands/battery.js +31 -0
- package/build/commands/battery.js.map +1 -0
- package/build/commands/logcat.d.ts +24 -0
- package/build/commands/logcat.d.ts.map +1 -0
- package/build/commands/logcat.js +261 -0
- package/build/commands/logcat.js.map +1 -0
- package/build/commands/open.d.ts +1 -1
- package/build/commands/open.d.ts.map +1 -1
- package/build/commands/open.js +14 -14
- package/build/commands/open.js.map +1 -1
- package/build/commands/screenshot.d.ts +1 -1
- package/build/commands/screenshot.d.ts.map +1 -1
- package/build/commands/screenshot.js +55 -9
- package/build/commands/screenshot.js.map +1 -1
- package/build/commands/stay-awake.d.ts +14 -0
- package/build/commands/stay-awake.d.ts.map +1 -0
- package/build/commands/stay-awake.js +234 -0
- package/build/commands/stay-awake.js.map +1 -0
- package/build/index.js +84 -5
- package/build/index.js.map +1 -1
- package/build/utils/adb.d.ts +12 -7
- package/build/utils/adb.d.ts.map +1 -1
- package/build/utils/adb.js +138 -31
- package/build/utils/adb.js.map +1 -1
- package/build/utils/filename.d.ts +9 -0
- package/build/utils/filename.d.ts.map +1 -0
- package/build/utils/filename.js +17 -0
- package/build/utils/filename.js.map +1 -0
- package/build/utils/filename.test.d.ts +5 -0
- package/build/utils/filename.test.d.ts.map +1 -0
- package/build/utils/filename.test.js +40 -0
- package/build/utils/filename.test.js.map +1 -0
- package/package.json +2 -1
- package/src/commands/battery.ts +34 -0
- package/src/commands/logcat.ts +288 -0
- package/src/commands/open.ts +18 -14
- package/src/commands/screenshot.ts +61 -9
- package/src/commands/stay-awake.ts +254 -0
- package/src/index.ts +119 -9
- package/src/utils/adb.ts +148 -31
- package/src/utils/filename.test.ts +55 -0
- package/src/utils/filename.ts +18 -0
- package/tests/adb.test.ts +2 -2
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Quest stay-awake command
|
|
3
|
+
* Keeps Quest screen awake by setting screen timeout to 24 hours
|
|
4
|
+
* Restores original timeout on exit (Ctrl-C)
|
|
5
|
+
*/
|
|
6
|
+
import { checkADBPath } from '../utils/adb.js';
|
|
7
|
+
import { execCommand } from '../utils/exec.js';
|
|
8
|
+
import { execSync, spawn } from 'child_process';
|
|
9
|
+
import * as os from 'os';
|
|
10
|
+
import * as fs from 'fs';
|
|
11
|
+
/**
|
|
12
|
+
* Get current screen timeout setting
|
|
13
|
+
*/
|
|
14
|
+
async function getScreenTimeout() {
|
|
15
|
+
const output = await execCommand('adb', ['shell', 'settings', 'get', 'system', 'screen_off_timeout']);
|
|
16
|
+
return parseInt(output.trim(), 10);
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Set screen timeout (in milliseconds)
|
|
20
|
+
*/
|
|
21
|
+
async function setScreenTimeout(timeout) {
|
|
22
|
+
await execCommand('adb', ['shell', 'settings', 'put', 'system', 'screen_off_timeout', timeout.toString()]);
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Disable Quest proximity sensor (keeps screen on even when not worn)
|
|
26
|
+
*/
|
|
27
|
+
async function disableProximitySensor() {
|
|
28
|
+
await execCommand('adb', ['shell', 'am', 'broadcast', '-a', 'com.oculus.vrpowermanager.prox_close']);
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Enable Quest proximity sensor (re-enable normal behavior)
|
|
32
|
+
* Note: automation_disable actually RE-ENABLES normal proximity sensor automation
|
|
33
|
+
*/
|
|
34
|
+
async function enableProximitySensor() {
|
|
35
|
+
await execCommand('adb', ['shell', 'am', 'broadcast', '-a', 'com.oculus.vrpowermanager.automation_disable']);
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Wake the Quest screen
|
|
39
|
+
*/
|
|
40
|
+
async function wakeScreen() {
|
|
41
|
+
await execCommand('adb', ['shell', 'input', 'keyevent', 'KEYCODE_WAKEUP']);
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Child watchdog process - polls for parent death and cleans up
|
|
45
|
+
*/
|
|
46
|
+
export async function stayAwakeWatchdog(parentPid, originalTimeout) {
|
|
47
|
+
const pollInterval = 5000; // Check every 5 seconds
|
|
48
|
+
const checkParent = setInterval(() => {
|
|
49
|
+
try {
|
|
50
|
+
// Check if parent process still exists
|
|
51
|
+
process.kill(parentPid, 0);
|
|
52
|
+
// Parent still alive, continue polling
|
|
53
|
+
}
|
|
54
|
+
catch {
|
|
55
|
+
// Parent is dead - perform cleanup
|
|
56
|
+
console.log('Parent process died, restoring Quest settings...');
|
|
57
|
+
clearInterval(checkParent);
|
|
58
|
+
// Restore settings synchronously
|
|
59
|
+
try {
|
|
60
|
+
execSync(`adb shell settings put system screen_off_timeout ${originalTimeout}`, { stdio: 'ignore' });
|
|
61
|
+
execSync(`adb shell am broadcast -a com.oculus.vrpowermanager.automation_disable`, { stdio: 'ignore' });
|
|
62
|
+
// Cleanup PID file
|
|
63
|
+
const pidFile = `${os.homedir()}/.quest-dev-stay-awake.pid`;
|
|
64
|
+
try {
|
|
65
|
+
fs.unlinkSync(pidFile);
|
|
66
|
+
}
|
|
67
|
+
catch { }
|
|
68
|
+
console.log(`Screen timeout restored to ${originalTimeout}ms (${Math.round(originalTimeout / 1000)}s)`);
|
|
69
|
+
console.log('Proximity sensor re-enabled');
|
|
70
|
+
}
|
|
71
|
+
catch (err) {
|
|
72
|
+
console.error('Failed to restore settings:', err.message);
|
|
73
|
+
}
|
|
74
|
+
process.exit(0);
|
|
75
|
+
}
|
|
76
|
+
}, pollInterval);
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Main stay-awake command handler
|
|
80
|
+
*/
|
|
81
|
+
export async function stayAwakeCommand(idleTimeout = 300000) {
|
|
82
|
+
// Check prerequisites
|
|
83
|
+
checkADBPath();
|
|
84
|
+
// Check devices without verbose output
|
|
85
|
+
try {
|
|
86
|
+
const output = await execCommand('adb', ['devices']);
|
|
87
|
+
const lines = output.trim().split('\n').slice(1);
|
|
88
|
+
const devices = lines.filter(line => line.trim() && !line.includes('List of devices'));
|
|
89
|
+
if (devices.length === 0) {
|
|
90
|
+
console.error('Error: No ADB devices connected');
|
|
91
|
+
process.exit(1);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
catch (error) {
|
|
95
|
+
console.error('Error: Failed to list ADB devices');
|
|
96
|
+
process.exit(1);
|
|
97
|
+
}
|
|
98
|
+
// PID file management
|
|
99
|
+
const pidFilePath = `${os.homedir()}/.quest-dev-stay-awake.pid`;
|
|
100
|
+
// Check for existing process
|
|
101
|
+
if (fs.existsSync(pidFilePath)) {
|
|
102
|
+
const existingPid = parseInt(fs.readFileSync(pidFilePath, 'utf-8'));
|
|
103
|
+
try {
|
|
104
|
+
process.kill(existingPid, 0); // Test if process exists
|
|
105
|
+
console.error(`Error: stay-awake is already running (PID: ${existingPid})`);
|
|
106
|
+
process.exit(1);
|
|
107
|
+
}
|
|
108
|
+
catch {
|
|
109
|
+
// Process dead, cleanup stale PID file
|
|
110
|
+
fs.unlinkSync(pidFilePath);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
// Get original timeout
|
|
114
|
+
let originalTimeout;
|
|
115
|
+
try {
|
|
116
|
+
originalTimeout = await getScreenTimeout();
|
|
117
|
+
console.log(`Original screen timeout: ${originalTimeout}ms (${Math.round(originalTimeout / 1000)}s)`);
|
|
118
|
+
}
|
|
119
|
+
catch (error) {
|
|
120
|
+
console.error('Failed to get current screen timeout');
|
|
121
|
+
process.exit(1);
|
|
122
|
+
}
|
|
123
|
+
// Write PID file
|
|
124
|
+
try {
|
|
125
|
+
fs.writeFileSync(pidFilePath, process.pid.toString());
|
|
126
|
+
}
|
|
127
|
+
catch (error) {
|
|
128
|
+
console.warn('Failed to write PID file, hook will not work');
|
|
129
|
+
}
|
|
130
|
+
// Spawn child watchdog process
|
|
131
|
+
let childProcess = null;
|
|
132
|
+
try {
|
|
133
|
+
childProcess = spawn(process.execPath, [
|
|
134
|
+
process.argv[1], // quest-dev script path
|
|
135
|
+
'stay-awake-watchdog',
|
|
136
|
+
'--parent-pid', process.pid.toString(),
|
|
137
|
+
'--original-timeout', originalTimeout.toString()
|
|
138
|
+
], {
|
|
139
|
+
detached: true,
|
|
140
|
+
stdio: 'ignore'
|
|
141
|
+
});
|
|
142
|
+
childProcess.unref(); // Allow parent to exit without waiting for child
|
|
143
|
+
}
|
|
144
|
+
catch (error) {
|
|
145
|
+
console.warn('Failed to spawn watchdog child process');
|
|
146
|
+
}
|
|
147
|
+
// Wake screen and disable proximity sensor
|
|
148
|
+
try {
|
|
149
|
+
await wakeScreen();
|
|
150
|
+
console.log('Quest screen woken up');
|
|
151
|
+
await disableProximitySensor();
|
|
152
|
+
console.log('Proximity sensor disabled');
|
|
153
|
+
}
|
|
154
|
+
catch (error) {
|
|
155
|
+
console.error('Failed to wake screen or disable proximity sensor:', error.message);
|
|
156
|
+
}
|
|
157
|
+
// Set timeout to 24 hours (86400000ms)
|
|
158
|
+
const longTimeout = 86400000;
|
|
159
|
+
try {
|
|
160
|
+
await setScreenTimeout(longTimeout);
|
|
161
|
+
console.log(`Screen timeout set to 24 hours`);
|
|
162
|
+
console.log(`Quest will stay awake (idle timeout: ${Math.round(idleTimeout / 1000)}s). Press Ctrl-C to restore original settings.`);
|
|
163
|
+
}
|
|
164
|
+
catch (error) {
|
|
165
|
+
console.error('Failed to set screen timeout');
|
|
166
|
+
process.exit(1);
|
|
167
|
+
}
|
|
168
|
+
// Idle timer mechanism
|
|
169
|
+
let idleTimerHandle = null;
|
|
170
|
+
let cleanupInProgress = false;
|
|
171
|
+
const resetIdleTimer = () => {
|
|
172
|
+
if (idleTimerHandle)
|
|
173
|
+
clearTimeout(idleTimerHandle);
|
|
174
|
+
idleTimerHandle = setTimeout(() => {
|
|
175
|
+
console.log('\nIdle timeout reached, exiting...');
|
|
176
|
+
cleanup();
|
|
177
|
+
}, idleTimeout);
|
|
178
|
+
};
|
|
179
|
+
// Set up cleanup on exit (must be synchronous for signal handlers)
|
|
180
|
+
const cleanup = () => {
|
|
181
|
+
if (cleanupInProgress)
|
|
182
|
+
return; // Guard against double-cleanup
|
|
183
|
+
cleanupInProgress = true;
|
|
184
|
+
// Clear idle timer
|
|
185
|
+
if (idleTimerHandle)
|
|
186
|
+
clearTimeout(idleTimerHandle);
|
|
187
|
+
// Kill child watchdog
|
|
188
|
+
if (childProcess) {
|
|
189
|
+
try {
|
|
190
|
+
childProcess.kill();
|
|
191
|
+
}
|
|
192
|
+
catch { }
|
|
193
|
+
}
|
|
194
|
+
console.log('\nRestoring original settings...');
|
|
195
|
+
try {
|
|
196
|
+
// Remove PID file
|
|
197
|
+
try {
|
|
198
|
+
fs.unlinkSync(pidFilePath);
|
|
199
|
+
}
|
|
200
|
+
catch { }
|
|
201
|
+
// Restore Quest settings
|
|
202
|
+
execSync(`adb shell settings put system screen_off_timeout ${originalTimeout}`, { stdio: 'ignore' });
|
|
203
|
+
execSync(`adb shell am broadcast -a com.oculus.vrpowermanager.automation_disable`, { stdio: 'ignore' });
|
|
204
|
+
console.log(`Screen timeout restored to ${originalTimeout}ms (${Math.round(originalTimeout / 1000)}s)`);
|
|
205
|
+
console.log(`Proximity sensor re-enabled`);
|
|
206
|
+
}
|
|
207
|
+
catch (error) {
|
|
208
|
+
console.error('Failed to restore settings:', error.message);
|
|
209
|
+
}
|
|
210
|
+
process.exit(0);
|
|
211
|
+
};
|
|
212
|
+
// Handle Ctrl-C and termination
|
|
213
|
+
process.on('SIGINT', cleanup);
|
|
214
|
+
process.on('SIGTERM', cleanup);
|
|
215
|
+
process.on('SIGHUP', cleanup);
|
|
216
|
+
// Handle SIGUSR1 for activity reset
|
|
217
|
+
process.on('SIGUSR1', () => {
|
|
218
|
+
console.log('Activity detected, resetting idle timer');
|
|
219
|
+
resetIdleTimer();
|
|
220
|
+
});
|
|
221
|
+
// Start idle timer
|
|
222
|
+
resetIdleTimer();
|
|
223
|
+
// Keep process running with an interval that does nothing
|
|
224
|
+
console.log('Keeping Quest awake...');
|
|
225
|
+
setInterval(() => {
|
|
226
|
+
// Do nothing, just keep process alive
|
|
227
|
+
}, 60000); // Check every minute
|
|
228
|
+
// Prevent process from exiting
|
|
229
|
+
await new Promise((resolve) => {
|
|
230
|
+
// This will only resolve when cleanup is called
|
|
231
|
+
process.on('exit', () => resolve());
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
//# sourceMappingURL=stay-awake.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stay-awake.js","sourceRoot":"","sources":["../../src/commands/stay-awake.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAgB,MAAM,eAAe,CAAC;AAC9D,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AAEzB;;GAEG;AACH,KAAK,UAAU,gBAAgB;IAC7B,MAAM,MAAM,GAAG,MAAM,WAAW,CAAC,KAAK,EAAE,CAAC,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,QAAQ,EAAE,oBAAoB,CAAC,CAAC,CAAC;IACtG,OAAO,QAAQ,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC;AACrC,CAAC;AAED;;GAEG;AACH,KAAK,UAAU,gBAAgB,CAAC,OAAe;IAC7C,MAAM,WAAW,CAAC,KAAK,EAAE,CAAC,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,QAAQ,EAAE,oBAAoB,EAAE,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC;AAC7G,CAAC;AAED;;GAEG;AACH,KAAK,UAAU,sBAAsB;I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A6B,CAAC,CAAC;QAC7C,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,KAAK,CAAC,6BAA6B,EAAG,KAAe,CAAC,OAAO,CAAC,CAAC;QACzE,CAAC;QACD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC,CAAC;IAEF,gCAAgC;IAChC,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IAC9B,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;IAC/B,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IAE9B,oCAAoC;IACpC,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,GAAG,EAAE;QACzB,OAAO,CAAC,GAAG,CAAC,yCAAyC,CAAC,CAAC;QACvD,cAAc,EAAE,CAAC;IACnB,CAAC,CAAC,CAAC;IAEH,mBAAmB;IACnB,cAAc,EAAE,CAAC;IAEjB,0DAA0D;IAC1D,OAAO,CAAC,GAAG,CAAC,wBAAwB,CAAC,CAAC;IACtC,WAAW,CAAC,GAAG,EAAE;QACf,sCAAsC;IACxC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,qBAAqB;IAEhC,+BAA+B;IAC/B,MAAM,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,EAAE;QAClC,gDAAgD;QAChD,OAAO,CAAC,EAAE,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,OAAO,EAAE,CAAC,CAAC;IACtC,CAAC,CAAC,CAAC;AACL,CAAC"}
|
package/build/index.js
CHANGED
|
@@ -10,6 +10,9 @@ import { fileURLToPath } from 'url';
|
|
|
10
10
|
import { dirname, join } from 'path';
|
|
11
11
|
import { screenshotCommand } from './commands/screenshot.js';
|
|
12
12
|
import { openCommand } from './commands/open.js';
|
|
13
|
+
import { startCommand, stopCommand, statusCommand, tailCommand } from './commands/logcat.js';
|
|
14
|
+
import { batteryCommand } from './commands/battery.js';
|
|
15
|
+
import { stayAwakeCommand, stayAwakeWatchdog } from './commands/stay-awake.js';
|
|
13
16
|
// Read version from package.json
|
|
14
17
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
15
18
|
const packageJson = JSON.parse(readFileSync(join(__dirname, '../package.json'), 'utf-8'));
|
|
@@ -35,14 +38,20 @@ const cli = yargs(hideBin(process.argv))
|
|
|
35
38
|
.alias('help', 'h')
|
|
36
39
|
.epilog('Requires ADB and Quest connected via USB. Sets up CDP on port 9223 for cdp-cli.');
|
|
37
40
|
// Screenshot command
|
|
38
|
-
cli.command('screenshot <
|
|
39
|
-
return yargs
|
|
40
|
-
|
|
41
|
+
cli.command('screenshot <directory>', 'Take a screenshot from Quest and save to directory with auto-generated filename', (yargs) => {
|
|
42
|
+
return yargs
|
|
43
|
+
.positional('directory', {
|
|
44
|
+
describe: 'Output directory path (e.g., ~/screenshots)',
|
|
41
45
|
type: 'string',
|
|
42
46
|
demandOption: true
|
|
47
|
+
})
|
|
48
|
+
.option('caption', {
|
|
49
|
+
describe: 'Caption to embed in JPEG COM metadata',
|
|
50
|
+
type: 'string',
|
|
51
|
+
alias: 'c'
|
|
43
52
|
});
|
|
44
53
|
}, async (argv) => {
|
|
45
|
-
await screenshotCommand(argv.
|
|
54
|
+
await screenshotCommand(argv.directory, argv.caption);
|
|
46
55
|
});
|
|
47
56
|
// Open command
|
|
48
57
|
cli.command('open <url>', 'Open URL in Quest browser (sets up CDP debugging port forwarding)', (yargs) => {
|
|
@@ -56,9 +65,79 @@ cli.command('open <url>', 'Open URL in Quest browser (sets up CDP debugging port
|
|
|
56
65
|
describe: 'Close all other tabs before opening',
|
|
57
66
|
type: 'boolean',
|
|
58
67
|
default: false
|
|
68
|
+
})
|
|
69
|
+
.option('browser', {
|
|
70
|
+
describe: 'Browser package name (e.g., com.oculus.browser, org.chromium.chrome)',
|
|
71
|
+
type: 'string',
|
|
72
|
+
default: 'com.oculus.browser',
|
|
73
|
+
alias: 'b'
|
|
74
|
+
});
|
|
75
|
+
}, async (argv) => {
|
|
76
|
+
await openCommand(argv.url, argv.closeOthers, argv.browser);
|
|
77
|
+
});
|
|
78
|
+
// Logcat command
|
|
79
|
+
cli.command('logcat <action>', 'Capture Android logcat to files (CRITICAL: always start before testing to avoid losing crash logs)', (yargs) => {
|
|
80
|
+
return yargs
|
|
81
|
+
.positional('action', {
|
|
82
|
+
describe: 'Action to perform',
|
|
83
|
+
type: 'string',
|
|
84
|
+
choices: ['start', 'stop', 'status', 'tail'],
|
|
85
|
+
demandOption: true
|
|
86
|
+
})
|
|
87
|
+
.option('filter', {
|
|
88
|
+
describe: 'Logcat filter expression (e.g., "*:W" for warnings+, "chromium:V *:S" for chromium only)',
|
|
89
|
+
type: 'string'
|
|
90
|
+
});
|
|
91
|
+
}, async (argv) => {
|
|
92
|
+
const action = argv.action;
|
|
93
|
+
const filter = argv.filter;
|
|
94
|
+
switch (action) {
|
|
95
|
+
case 'start':
|
|
96
|
+
await startCommand(filter);
|
|
97
|
+
break;
|
|
98
|
+
case 'stop':
|
|
99
|
+
await stopCommand();
|
|
100
|
+
break;
|
|
101
|
+
case 'status':
|
|
102
|
+
await statusCommand();
|
|
103
|
+
break;
|
|
104
|
+
case 'tail':
|
|
105
|
+
await tailCommand();
|
|
106
|
+
break;
|
|
107
|
+
default:
|
|
108
|
+
console.error(`Unknown action: ${action}`);
|
|
109
|
+
process.exit(1);
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
// Battery command
|
|
113
|
+
cli.command('battery', 'Show Quest battery percentage and charging status', () => { }, async () => {
|
|
114
|
+
await batteryCommand();
|
|
115
|
+
});
|
|
116
|
+
// Stay-awake command
|
|
117
|
+
cli.command('stay-awake', 'Keep Quest screen awake (sets 24hr timeout, restores on Ctrl-C)', (yargs) => {
|
|
118
|
+
return yargs.option('idle-timeout', {
|
|
119
|
+
describe: 'Idle timeout in milliseconds (default: 300000 = 5 minutes)',
|
|
120
|
+
type: 'number',
|
|
121
|
+
default: 300000,
|
|
122
|
+
alias: 'i'
|
|
123
|
+
});
|
|
124
|
+
}, async (argv) => {
|
|
125
|
+
await stayAwakeCommand(argv.idleTimeout);
|
|
126
|
+
});
|
|
127
|
+
// Stay-awake watchdog (internal subcommand, spawned by stay-awake parent)
|
|
128
|
+
cli.command('stay-awake-watchdog', false, // Hide from help
|
|
129
|
+
(yargs) => {
|
|
130
|
+
return yargs
|
|
131
|
+
.option('parent-pid', {
|
|
132
|
+
type: 'number',
|
|
133
|
+
demandOption: true
|
|
134
|
+
})
|
|
135
|
+
.option('original-timeout', {
|
|
136
|
+
type: 'number',
|
|
137
|
+
demandOption: true
|
|
59
138
|
});
|
|
60
139
|
}, async (argv) => {
|
|
61
|
-
await
|
|
140
|
+
await stayAwakeWatchdog(argv.parentPid, argv.originalTimeout);
|
|
62
141
|
});
|
|
63
142
|
// Parse and execute
|
|
64
143
|
cli.parse();
|
package/build/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA;;;GAGG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AACrC,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA;;;GAGG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,YAAY,EA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KAAK,IAAI,EAAE;IACT,MAAM,cAAc,EAAE,CAAC;AACzB,CAAC,CACF,CAAC;AAEF,qBAAqB;AACrB,GAAG,CAAC,OAAO,CACT,YAAY,EACZ,iEAAiE,EACjE,CAAC,KAAK,EAAE,EAAE;IACR,OAAO,KAAK,CAAC,MAAM,CAAC,cAAc,EAAE;QAClC,QAAQ,EAAE,4DAA4D;QACtE,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,MAAM;QACf,KAAK,EAAE,GAAG;KACX,CAAC,CAAC;AACL,CAAC,EACD,KAAK,EAAE,IAAI,EAAE,EAAE;IACb,MAAM,gBAAgB,CAAC,IAAI,CAAC,WAAqB,CAAC,CAAC;AACrD,CAAC,CACF,CAAC;AAEF,0EAA0E;AAC1E,GAAG,CAAC,OAAO,CACT,qBAAqB,EACrB,KAAY,EAAE,iBAAiB;AAC/B,CAAC,KAAK,EAAE,EAAE;IACR,OAAO,KAAK;SACT,MAAM,CAAC,YAAY,EAAE;QACpB,IAAI,EAAE,QAAQ;QACd,YAAY,EAAE,IAAI;KACnB,CAAC;SACD,MAAM,CAAC,kBAAkB,EAAE;QAC1B,IAAI,EAAE,QAAQ;QACd,YAAY,EAAE,IAAI;KACnB,CAAC,CAAC;AACP,CAAC,EACD,KAAK,EAAE,IAAI,EAAE,EAAE;IACb,MAAM,iBAAiB,CAAC,IAAI,CAAC,SAAmB,EAAE,IAAI,CAAC,eAAyB,CAAC,CAAC;AACpF,CAAC,CACF,CAAC;AAEF,oBAAoB;AACpB,GAAG,CAAC,KAAK,EAAE,CAAC"}
|
package/build/utils/adb.d.ts
CHANGED
|
@@ -16,23 +16,23 @@ export declare function isPortListening(port: number): Promise<boolean>;
|
|
|
16
16
|
/**
|
|
17
17
|
* Idempotently set up ADB port forwarding for a given port
|
|
18
18
|
*/
|
|
19
|
-
export declare function ensurePortForwarding(port: number): Promise<void>;
|
|
19
|
+
export declare function ensurePortForwarding(port: number, browser?: string): Promise<void>;
|
|
20
20
|
/**
|
|
21
|
-
* Check if
|
|
21
|
+
* Check if browser is running
|
|
22
22
|
*/
|
|
23
|
-
export declare function isBrowserRunning(): Promise<boolean>;
|
|
23
|
+
export declare function isBrowserRunning(browser?: string): Promise<boolean>;
|
|
24
24
|
/**
|
|
25
|
-
* Launch
|
|
25
|
+
* Launch browser with a URL using am start
|
|
26
26
|
*/
|
|
27
|
-
export declare function launchBrowser(url: string): Promise<boolean>;
|
|
27
|
+
export declare function launchBrowser(url: string, browser?: string): Promise<boolean>;
|
|
28
28
|
/**
|
|
29
29
|
* Get CDP port
|
|
30
30
|
*/
|
|
31
|
-
export declare function getCDPPort(): number
|
|
31
|
+
export declare function getCDPPort(browser?: string): Promise<number>;
|
|
32
32
|
/**
|
|
33
33
|
* Set up only CDP forwarding (for external URLs that don't need reverse forwarding)
|
|
34
34
|
*/
|
|
35
|
-
export declare function ensureCDPForwarding(): Promise<void>;
|
|
35
|
+
export declare function ensureCDPForwarding(browser?: string): Promise<void>;
|
|
36
36
|
/**
|
|
37
37
|
* Check if USB file transfer is authorized on Quest
|
|
38
38
|
* After reboot, user must click notification to allow file access
|
|
@@ -43,4 +43,9 @@ export declare function checkUSBFileTransfer(): Promise<void>;
|
|
|
43
43
|
* Screenshots cannot be taken when the display is off
|
|
44
44
|
*/
|
|
45
45
|
export declare function checkQuestAwake(): Promise<void>;
|
|
46
|
+
/**
|
|
47
|
+
* Get Quest battery status
|
|
48
|
+
* Returns percentage and charging state in one line
|
|
49
|
+
*/
|
|
50
|
+
export declare function getBatteryStatus(): Promise<string>;
|
|
46
51
|
//# sourceMappingURL=adb.d.ts.map
|
package/build/utils/adb.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adb.d.ts","sourceRoot":"","sources":["../../src/utils/adb.ts"],"names":[],"mappings":"AAAA;;GAEG;
|
|
1
|
+
{"version":3,"file":"adb.d.ts","sourceRoot":"","sources":["../../src/utils/adb.ts"],"names":[],"mappings":"AAAA;;GAEG;AAiEH;;GAEG;AACH,wBAAgB,YAAY,IAAI,MAAM,CAiBrC;AAoBD;;GAEG;AACH,wBAAsB,eAAe,CAAC,UAAU,SAAI,GAAG,OAAO,CAAC,OAAO,CAAC,CAqCtE;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAiB9D;AAED;;GAEG;AACH,wBAAsB,oBAAoB,CACxC,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE,MAA6B,GACrC,OAAO,CAAC,IAAI,CAAC,CA8Cf;AAED;;GAEG;AACH,wBAAsB,gBAAgB,CAAC,OAAO,GAAE,MAA6B,GAAG,OAAO,CAAC,OAAO,CAAC,CAO/F;AAED;;GAEG;AACH,wBAAsB,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,GAAE,MAA6B,GAAG,OAAO,CAAC,OAAO,CAAC,CAmBzG;AAED;;GAEG;AACH,wBAAsB,UAAU,CAAC,OAAO,GAAE,MAA6B,GAAG,OAAO,CAAC,MAAM,CAAC,CAGxF;AAED;;GAEG;AACH,wBAAsB,mBAAmB,CACvC,OAAO,GAAE,MAA6B,GACrC,OAAO,CAAC,IAAI,CAAC,CAkCf;AAED;;;GAGG;AACH,wBAAsB,oBAAoB,IAAI,OAAO,CAAC,IAAI,CAAC,CAe1D;AAED;;;GAGG;AACH,wBAAsB,eAAe,IAAI,OAAO,CAAC,IAAI,CAAC,CAUrD;AAED;;;GAGG;AACH,wBAAsB,gBAAgB,IAAI,OAAO,CAAC,MAAM,CAAC,CAyCxD"}
|