open-agents-ai 0.187.140 → 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.
Files changed (2) hide show
  1. package/dist/index.js +79 -40
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -242342,11 +242342,11 @@ var require_out = __commonJS({
242342
242342
  async.read(path5, getSettings(optionsOrSettingsOrCallback), callback);
242343
242343
  }
242344
242344
  exports.stat = stat6;
242345
- function statSync21(path5, optionsOrSettings) {
242345
+ function statSync22(path5, optionsOrSettings) {
242346
242346
  const settings = getSettings(optionsOrSettings);
242347
242347
  return sync.read(path5, settings);
242348
242348
  }
242349
- exports.statSync = statSync21;
242349
+ exports.statSync = statSync22;
242350
242350
  function getSettings(settingsOrOptions = {}) {
242351
242351
  if (settingsOrOptions instanceof settings_1.default) {
242352
242352
  return settingsOrOptions;
@@ -255381,13 +255381,14 @@ ${info}`, durationMs: performance.now() - start2 };
255381
255381
 
255382
255382
  // packages/execution/dist/tools/sdr-scan.js
255383
255383
  import { execSync as execSync32 } from "node:child_process";
255384
- import { readFileSync as readFileSync23, unlinkSync as unlinkSync7, existsSync as existsSync31, mkdirSync as mkdirSync12 } from "node:fs";
255384
+ import { readFileSync as readFileSync23, unlinkSync as unlinkSync7, existsSync as existsSync31, mkdirSync as mkdirSync12, statSync as statSync13 } from "node:fs";
255385
255385
  import { join as join46 } from "node:path";
255386
255386
  import { tmpdir as tmpdir10 } from "node:os";
255387
255387
  var SdrScanTool;
255388
255388
  var init_sdr_scan = __esm({
255389
255389
  "packages/execution/dist/tools/sdr-scan.js"() {
255390
255390
  "use strict";
255391
+ init_system_auth();
255391
255392
  SdrScanTool = class {
255392
255393
  name = "sdr_scan";
255393
255394
  description = "Scan radio frequencies with an RTL-SDR dongle. Actions: 'info' to check SDR hardware, 'scan' to sweep a frequency range, 'adsb' to detect aircraft transponders (1090 MHz), 'fm' to tune FM radio. Use this to explore the RF spectrum, detect signals, monitor aircraft, or listen to FM broadcasts. Requires an RTL-SDR USB dongle.";
@@ -255442,26 +255443,66 @@ var init_sdr_scan = __esm({
255442
255443
  return { success: false, output: "", error: `sdr_scan error: ${err instanceof Error ? err.message : String(err)}`, durationMs: performance.now() - start2 };
255443
255444
  }
255444
255445
  }
255445
- /** Auto-install rtl-sdr tools when hardware is detected but tools are missing */
255446
- ensureSdrTools() {
255446
+ /** Auto-install rtl-sdr tools AND configure udev rules when hardware is detected.
255447
+ * Uses system-native privilege elevation (pkexec/osascript/UAC) to trigger
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
+ */
255456
+ async ensureSdrTools() {
255447
255457
  try {
255448
255458
  execSync32("which rtl_test", { timeout: 3e3, stdio: "pipe" });
255449
- return true;
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
+ }
255466
+ } catch {
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(" && ");
255482
+ try {
255483
+ const result = await runElevated(setupScript, {
255484
+ timeout: 12e4,
255485
+ description: "Open Agents needs to install RTL-SDR radio tools and configure device access"
255486
+ });
255487
+ if (result.success)
255488
+ return true;
255450
255489
  } catch {
255451
255490
  }
255452
255491
  try {
255453
- execSync32("sudo -n apt-get install -y rtl-sdr 2>&1", { timeout: 6e4, stdio: "pipe" });
255492
+ execSync32("which rtl_test", { timeout: 3e3, stdio: "pipe" });
255454
255493
  return true;
255455
255494
  } catch {
255456
- try {
255457
- execSync32("apt list --installed 2>/dev/null | grep rtl-sdr", { timeout: 5e3, stdio: "pipe" });
255458
- return true;
255459
- } catch {
255460
- }
255461
255495
  }
255462
255496
  return false;
255463
255497
  }
255464
- deviceInfo(start2) {
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
+ }
255505
+ async deviceInfo(start2) {
255465
255506
  let usbDetected = false;
255466
255507
  let usbLine = "";
255467
255508
  try {
@@ -255478,7 +255519,7 @@ var init_sdr_scan = __esm({
255478
255519
  if (!usbDetected) {
255479
255520
  return { success: true, output: "No RTL-SDR device found. Connect an RTL-SDR USB dongle.", durationMs: performance.now() - start2 };
255480
255521
  }
255481
- const toolsReady = this.ensureSdrTools();
255522
+ const toolsReady = await this.ensureSdrTools();
255482
255523
  if (!toolsReady) {
255483
255524
  return {
255484
255525
  success: true,
@@ -255505,15 +255546,13 @@ Tools installed but rtl_test failed \u2014 device may be in use by another proce
255505
255546
  };
255506
255547
  }
255507
255548
  }
255508
- frequencyScan(args, start2) {
255549
+ async frequencyScan(args, start2) {
255509
255550
  const startFreq = args["start_freq"] || "433M";
255510
255551
  const endFreq = args["end_freq"] || "434M";
255511
255552
  const duration = args["duration"] || 10;
255512
255553
  const gain = args["gain"];
255513
- try {
255514
- execSync32("which rtl_power", { timeout: 3e3, stdio: "pipe" });
255515
- } catch {
255516
- return { success: false, output: "", error: "rtl_power not installed. Run: sudo apt install rtl-sdr", durationMs: performance.now() - start2 };
255554
+ if (!await this.ensureSdrTools()) {
255555
+ return { success: false, output: "", error: "rtl-sdr tools not installed. Connect an RTL-SDR dongle and retry (will prompt for install).", durationMs: performance.now() - start2 };
255517
255556
  }
255518
255557
  const captureDir = join46(tmpdir10(), "oa-sdr");
255519
255558
  if (!existsSync31(captureDir))
@@ -255564,7 +255603,7 @@ ${sigLines.join("\n")}`,
255564
255603
  return { success: false, output: "", error: `Scan failed: ${err instanceof Error ? err.message : String(err)}`, durationMs: performance.now() - start2 };
255565
255604
  }
255566
255605
  }
255567
- adsbScan(args, start2) {
255606
+ async adsbScan(args, start2) {
255568
255607
  const duration = args["duration"] || 30;
255569
255608
  for (const tool of ["dump1090", "rtl_adsb"]) {
255570
255609
  try {
@@ -255586,7 +255625,7 @@ ${output.slice(0, 2e3)}`,
255586
255625
  }
255587
255626
  return { success: false, output: "", error: "No ADS-B decoder available. Install: sudo apt install dump1090-mutability OR sudo apt install rtl-sdr", durationMs: performance.now() - start2 };
255588
255627
  }
255589
- fmTune(args, start2) {
255628
+ async fmTune(args, start2) {
255590
255629
  const frequency = args["frequency"] || "98.1M";
255591
255630
  const duration = Math.min(args["duration"] || 10, 30);
255592
255631
  try {
@@ -267025,7 +267064,7 @@ var init_constraint_learner = __esm({
267025
267064
  });
267026
267065
 
267027
267066
  // packages/orchestrator/dist/nexusBackend.js
267028
- import { existsSync as existsSync41, statSync as statSync13, openSync, readSync, closeSync, unlinkSync as unlinkSync9, writeFileSync as writeFileSync16 } from "node:fs";
267067
+ import { existsSync as existsSync41, statSync as statSync14, openSync, readSync, closeSync, unlinkSync as unlinkSync9, writeFileSync as writeFileSync16 } from "node:fs";
267029
267068
  import { watch as fsWatch } from "node:fs";
267030
267069
  import { join as join57 } from "node:path";
267031
267070
  import { tmpdir as tmpdir11 } from "node:os";
@@ -267331,7 +267370,7 @@ var init_nexusBackend = __esm({
267331
267370
  finish();
267332
267371
  }, 50);
267333
267372
  });
267334
- const stat6 = statSync13(streamFile, { throwIfNoEntry: false });
267373
+ const stat6 = statSync14(streamFile, { throwIfNoEntry: false });
267335
267374
  if (!stat6 || stat6.size <= position)
267336
267375
  continue;
267337
267376
  const fd = openSync(streamFile, "r");
@@ -275496,7 +275535,7 @@ import { EventEmitter as EventEmitter5 } from "node:events";
275496
275535
  import { randomBytes as randomBytes15 } from "node:crypto";
275497
275536
  import { URL as URL2 } from "node:url";
275498
275537
  import { loadavg, cpus as cpus2, totalmem as totalmem2, freemem as freemem2 } from "node:os";
275499
- import { existsSync as existsSync43, readFileSync as readFileSync32, writeFileSync as writeFileSync18, unlinkSync as unlinkSync10, mkdirSync as mkdirSync18, readdirSync as readdirSync10, statSync as statSync14 } from "node:fs";
275538
+ import { existsSync as existsSync43, readFileSync as readFileSync32, writeFileSync as writeFileSync18, unlinkSync as unlinkSync10, mkdirSync as mkdirSync18, readdirSync as readdirSync10, statSync as statSync15 } from "node:fs";
275500
275539
  import { join as join59 } from "node:path";
275501
275540
  function cleanForwardHeaders(raw, targetHost) {
275502
275541
  const out = {};
@@ -276779,7 +276818,7 @@ ${this.formatConnectionInfo()}`);
276779
276818
  let recentActive = 0;
276780
276819
  for (const f2 of files.slice(-10)) {
276781
276820
  try {
276782
- const st = statSync14(join59(invocDir, f2));
276821
+ const st = statSync15(join59(invocDir, f2));
276783
276822
  if (now - st.mtimeMs < 1e4) recentActive++;
276784
276823
  } catch {
276785
276824
  }
@@ -279008,7 +279047,7 @@ __export(oa_directory_exports, {
279008
279047
  writeIndexData: () => writeIndexData,
279009
279048
  writeIndexMeta: () => writeIndexMeta
279010
279049
  });
279011
- import { existsSync as existsSync46, mkdirSync as mkdirSync20, readFileSync as readFileSync35, writeFileSync as writeFileSync20, readdirSync as readdirSync11, statSync as statSync15, unlinkSync as unlinkSync11 } from "node:fs";
279050
+ import { existsSync as existsSync46, mkdirSync as mkdirSync20, readFileSync as readFileSync35, writeFileSync as writeFileSync20, readdirSync as readdirSync11, statSync as statSync16, unlinkSync as unlinkSync11 } from "node:fs";
279012
279051
  import { join as join63, relative as relative4, basename as basename12 } from "node:path";
279013
279052
  import { homedir as homedir16 } from "node:os";
279014
279053
  function initOaDirectory(repoRoot) {
@@ -279220,7 +279259,7 @@ function loadRecentSessions(repoRoot, limit = 5) {
279220
279259
  if (!existsSync46(historyDir)) return [];
279221
279260
  try {
279222
279261
  const files = readdirSync11(historyDir).filter((f2) => f2.endsWith(".json") && f2 !== "pending-task.json").map((f2) => {
279223
- const stat6 = statSync15(join63(historyDir, f2));
279262
+ const stat6 = statSync16(join63(historyDir, f2));
279224
279263
  return { file: f2, mtime: stat6.mtimeMs };
279225
279264
  }).sort((a2, b) => b.mtime - a2.mtime).slice(0, limit);
279226
279265
  return files.map((f2) => {
@@ -284149,7 +284188,7 @@ __export(personaplex_exports, {
284149
284188
  startPersonaPlexDaemon: () => startPersonaPlexDaemon,
284150
284189
  stopPersonaPlex: () => stopPersonaPlex
284151
284190
  });
284152
- import { existsSync as existsSync47, writeFileSync as writeFileSync21, readFileSync as readFileSync37, mkdirSync as mkdirSync21, copyFileSync as copyFileSync2, readdirSync as readdirSync12, statSync as statSync16 } from "node:fs";
284191
+ import { existsSync as existsSync47, writeFileSync as writeFileSync21, readFileSync as readFileSync37, mkdirSync as mkdirSync21, copyFileSync as copyFileSync2, readdirSync as readdirSync12, statSync as statSync17 } from "node:fs";
284153
284192
  import { join as join64, dirname as dirname20 } from "node:path";
284154
284193
  import { homedir as homedir17 } from "node:os";
284155
284194
  import { execSync as execSync41, spawn as spawn20 } from "node:child_process";
@@ -284683,7 +284722,7 @@ print('Converted')
284683
284722
  }
284684
284723
  if (existsSync47(cachedBf16)) {
284685
284724
  extraArgs.push("--moshi-weight", cachedBf16);
284686
- log22(`Using distilled weights: ${(statSync16(cachedBf16).size / 1024 ** 3).toFixed(1)}GB`);
284725
+ log22(`Using distilled weights: ${(statSync17(cachedBf16).size / 1024 ** 3).toFixed(1)}GB`);
284687
284726
  } else {
284688
284727
  extraArgs.push("--moshi-weight", weightPath);
284689
284728
  }
@@ -284714,7 +284753,7 @@ print('Converted')
284714
284753
  );
284715
284754
  if (existsSync47(cachedBf16)) {
284716
284755
  extraArgs.push("--moshi-weight", cachedBf16);
284717
- log22(`Using dequantized cache: ${(statSync16(cachedBf16).size / 1024 ** 3).toFixed(1)}GB`);
284756
+ log22(`Using dequantized cache: ${(statSync17(cachedBf16).size / 1024 ** 3).toFixed(1)}GB`);
284718
284757
  }
284719
284758
  } catch (e2) {
284720
284759
  log22(`Dequantization failed \u2014 server will try to load original weights`);
@@ -289198,7 +289237,7 @@ __export(voice_exports, {
289198
289237
  registerCustomOnnxModel: () => registerCustomOnnxModel,
289199
289238
  resetNarrationContext: () => resetNarrationContext
289200
289239
  });
289201
- import { existsSync as existsSync53, mkdirSync as mkdirSync25, writeFileSync as writeFileSync25, readFileSync as readFileSync41, unlinkSync as unlinkSync14, readdirSync as readdirSync13, statSync as statSync17 } from "node:fs";
289240
+ import { existsSync as existsSync53, mkdirSync as mkdirSync25, writeFileSync as writeFileSync25, readFileSync as readFileSync41, unlinkSync as unlinkSync14, readdirSync as readdirSync13, statSync as statSync18 } from "node:fs";
289202
289241
  import { join as join69, dirname as dirname22 } from "node:path";
289203
289242
  import { homedir as homedir20, tmpdir as tmpdir13, platform as platform4 } from "node:os";
289204
289243
  import { execSync as execSync44, spawn as nodeSpawn } from "node:child_process";
@@ -290263,7 +290302,7 @@ var init_voice = __esm({
290263
290302
  const p2 = join69(dir, f2);
290264
290303
  let size = 0;
290265
290304
  try {
290266
- size = statSync17(p2).size;
290305
+ size = statSync18(p2).size;
290267
290306
  } catch {
290268
290307
  }
290269
290308
  return {
@@ -291950,7 +291989,7 @@ Error: ${err instanceof Error ? err.message : String(err)}`
291950
291989
  // packages/cli/src/tui/commands.ts
291951
291990
  import * as nodeOs from "node:os";
291952
291991
  import { execSync as nodeExecSync } from "node:child_process";
291953
- import { existsSync as existsSync54, readFileSync as readFileSync42, writeFileSync as writeFileSync26, mkdirSync as mkdirSync26, readdirSync as readdirSync14, statSync as statSync18, rmSync as rmSync2, appendFileSync as appendFileSync3 } from "node:fs";
291992
+ import { existsSync as existsSync54, readFileSync as readFileSync42, writeFileSync as writeFileSync26, mkdirSync as mkdirSync26, readdirSync as readdirSync14, statSync as statSync19, rmSync as rmSync2, appendFileSync as appendFileSync3 } from "node:fs";
291954
291993
  import { join as join70 } from "node:path";
291955
291994
  async function _immediateReregister(newUrl) {
291956
291995
  if (!_lastRegisteredSponsorPayload) return;
@@ -292887,7 +292926,7 @@ async function handleSlashCommand(input, ctx3) {
292887
292926
  ipfsFiles = files.length;
292888
292927
  for (const f2 of files) {
292889
292928
  try {
292890
- ipfsBytes += statSync18(join70(ipfsLocalDir, f2)).size;
292929
+ ipfsBytes += statSync19(join70(ipfsLocalDir, f2)).size;
292891
292930
  } catch {
292892
292931
  }
292893
292932
  }
@@ -292900,7 +292939,7 @@ async function handleSlashCommand(input, ctx3) {
292900
292939
  else {
292901
292940
  heliaBlocks++;
292902
292941
  try {
292903
- heliaBytes += statSync18(join70(dir, entry.name)).size;
292942
+ heliaBytes += statSync19(join70(dir, entry.name)).size;
292904
292943
  } catch {
292905
292944
  }
292906
292945
  }
@@ -292992,7 +293031,7 @@ async function handleSlashCommand(input, ctx3) {
292992
293031
  const count = memStore.count();
292993
293032
  lines.push(`
292994
293033
  ${c3.bold("Structured Memory (SQLite)")}`);
292995
- lines.push(` Memories: ${c3.bold(String(count))} DB: ${c3.dim(formatFileSize(statSync18(dbPath).size))}`);
293034
+ lines.push(` Memories: ${c3.bold(String(count))} DB: ${c3.dim(formatFileSize(statSync19(dbPath).size))}`);
292996
293035
  cDb(db);
292997
293036
  }
292998
293037
  } catch {
@@ -293023,7 +293062,7 @@ async function handleSlashCommand(input, ctx3) {
293023
293062
  walkStorage(full, subCat);
293024
293063
  } else {
293025
293064
  try {
293026
- const sz = statSync18(full).size;
293065
+ const sz = statSync19(full).size;
293027
293066
  totalBytes += sz;
293028
293067
  if (!categories[category]) categories[category] = { files: 0, bytes: 0 };
293029
293068
  categories[category].files++;
@@ -295356,7 +295395,7 @@ async function showCohereDashboard(ctx3) {
295356
295395
  const snapItems = snaps.slice(0, 20).map((f2) => ({
295357
295396
  key: f2,
295358
295397
  label: f2.replace(".json", ""),
295359
- detail: `${formatFileSize(statSync18(join70(snapDir, f2)).size)}`
295398
+ detail: `${formatFileSize(statSync19(join70(snapDir, f2)).size)}`
295360
295399
  }));
295361
295400
  if (snapItems.length > 0) {
295362
295401
  await tuiSelect({
@@ -315798,7 +315837,7 @@ __export(index_repo_exports, {
315798
315837
  indexRepoCommand: () => indexRepoCommand
315799
315838
  });
315800
315839
  import { resolve as resolve37 } from "node:path";
315801
- import { existsSync as existsSync71, statSync as statSync20 } from "node:fs";
315840
+ import { existsSync as existsSync71, statSync as statSync21 } from "node:fs";
315802
315841
  import { cwd as cwd2 } from "node:process";
315803
315842
  async function indexRepoCommand(opts, _config3) {
315804
315843
  const repoRoot = resolve37(opts.repoPath ?? cwd2());
@@ -315808,7 +315847,7 @@ async function indexRepoCommand(opts, _config3) {
315808
315847
  printError(`Path does not exist: ${repoRoot}`);
315809
315848
  process.exit(1);
315810
315849
  }
315811
- const stat6 = statSync20(repoRoot);
315850
+ const stat6 = statSync21(repoRoot);
315812
315851
  if (!stat6.isDirectory()) {
315813
315852
  printError(`Path is not a directory: ${repoRoot}`);
315814
315853
  process.exit(1);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "open-agents-ai",
3
- "version": "0.187.140",
3
+ "version": "0.187.142",
4
4
  "description": "AI coding agent powered by open-source models (Ollama/vLLM) — interactive TUI with agentic tool-calling loop",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",