open-agents-ai 0.187.141 → 0.187.142
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/index.js +39 -5
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -255443,19 +255443,46 @@ var init_sdr_scan = __esm({
|
|
|
255443
255443
|
return { success: false, output: "", error: `sdr_scan error: ${err instanceof Error ? err.message : String(err)}`, durationMs: performance.now() - start2 };
|
|
255444
255444
|
}
|
|
255445
255445
|
}
|
|
255446
|
-
/** Auto-install rtl-sdr tools when hardware is detected
|
|
255446
|
+
/** Auto-install rtl-sdr tools AND configure udev rules when hardware is detected.
|
|
255447
255447
|
* Uses system-native privilege elevation (pkexec/osascript/UAC) to trigger
|
|
255448
|
-
* the OS password dialog — no passwords stored in memory.
|
|
255448
|
+
* the OS password dialog — no passwords stored in memory.
|
|
255449
|
+
*
|
|
255450
|
+
* Full auto-setup sequence:
|
|
255451
|
+
* 1. Install rtl-sdr package (apt)
|
|
255452
|
+
* 2. Add udev rule for RTL-SDR device permissions
|
|
255453
|
+
* 3. Blacklist dvb_usb_rtl28xxu (TV driver that grabs the device)
|
|
255454
|
+
* 4. Reload udev rules and unload conflicting kernel modules
|
|
255455
|
+
*/
|
|
255449
255456
|
async ensureSdrTools() {
|
|
255450
255457
|
try {
|
|
255451
255458
|
execSync32("which rtl_test", { timeout: 3e3, stdio: "pipe" });
|
|
255452
|
-
|
|
255459
|
+
try {
|
|
255460
|
+
execSync32("timeout 2 rtl_test -t 2>&1 | grep -q 'Found'", { timeout: 5e3, stdio: "pipe" });
|
|
255461
|
+
return true;
|
|
255462
|
+
} catch {
|
|
255463
|
+
await this.fixSdrPermissions();
|
|
255464
|
+
return true;
|
|
255465
|
+
}
|
|
255453
255466
|
} catch {
|
|
255454
255467
|
}
|
|
255468
|
+
const setupScript = [
|
|
255469
|
+
// Install rtl-sdr tools
|
|
255470
|
+
"apt-get install -y rtl-sdr",
|
|
255471
|
+
// Add udev rule for device permissions (user-accessible without sudo)
|
|
255472
|
+
`echo 'SUBSYSTEM=="usb", ATTRS{idVendor}=="0bda", ATTRS{idProduct}=="2838", GROUP="plugdev", MODE="0666"' > /etc/udev/rules.d/99-rtlsdr.rules`,
|
|
255473
|
+
// Blacklist the DVB-T TV driver that conflicts with SDR use
|
|
255474
|
+
'echo "blacklist dvb_usb_rtl28xxu" > /etc/modprobe.d/blacklist-rtlsdr.conf',
|
|
255475
|
+
// Reload udev and unload conflicting modules
|
|
255476
|
+
"udevadm control --reload-rules",
|
|
255477
|
+
"udevadm trigger",
|
|
255478
|
+
"rmmod dvb_usb_rtl28xxu 2>/dev/null || true",
|
|
255479
|
+
"rmmod rtl2832 2>/dev/null || true",
|
|
255480
|
+
"rmmod dvb_usb_v2 2>/dev/null || true"
|
|
255481
|
+
].join(" && ");
|
|
255455
255482
|
try {
|
|
255456
|
-
const result = await runElevated(
|
|
255483
|
+
const result = await runElevated(setupScript, {
|
|
255457
255484
|
timeout: 12e4,
|
|
255458
|
-
description: "Open Agents needs to install RTL-SDR tools
|
|
255485
|
+
description: "Open Agents needs to install RTL-SDR radio tools and configure device access"
|
|
255459
255486
|
});
|
|
255460
255487
|
if (result.success)
|
|
255461
255488
|
return true;
|
|
@@ -255468,6 +255495,13 @@ var init_sdr_scan = __esm({
|
|
|
255468
255495
|
}
|
|
255469
255496
|
return false;
|
|
255470
255497
|
}
|
|
255498
|
+
/** Fix SDR device permissions without reinstalling tools */
|
|
255499
|
+
async fixSdrPermissions() {
|
|
255500
|
+
try {
|
|
255501
|
+
await runElevated(`echo 'SUBSYSTEM=="usb", ATTRS{idVendor}=="0bda", ATTRS{idProduct}=="2838", GROUP="plugdev", MODE="0666"' > /etc/udev/rules.d/99-rtlsdr.rules && echo "blacklist dvb_usb_rtl28xxu" > /etc/modprobe.d/blacklist-rtlsdr.conf && udevadm control --reload-rules && udevadm trigger && rmmod dvb_usb_rtl28xxu 2>/dev/null; rmmod rtl2832 2>/dev/null; true`, { timeout: 3e4, description: "Open Agents needs to configure RTL-SDR device permissions" });
|
|
255502
|
+
} catch {
|
|
255503
|
+
}
|
|
255504
|
+
}
|
|
255471
255505
|
async deviceInfo(start2) {
|
|
255472
255506
|
let usbDetected = false;
|
|
255473
255507
|
let usbLine = "";
|
package/package.json
CHANGED