@lardexx/arenacode 2.7.0 → 2.9.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/src/local.js CHANGED
@@ -531,22 +531,10 @@ async function runUiAction(bridge, taskId, request, opts) {
531
531
  };
532
532
 
533
533
  if (op === 'state') {
534
- const wins = automation.windows();
535
- const screen = automation.screenSize();
536
- const info = automation.sysinfo();
537
- if (!wins.ok) return wins;
538
- return {
539
- ok: true,
540
- windows: wins.windows,
541
- active_window: wins.active_window,
542
- interactive_elements: [],
543
- scrollable_elements: [],
544
- interactive_elements_text: '',
545
- system: info.system,
546
- screen: { width: screen.width, height: screen.height },
547
- // the terminal client reads windows and pixels, not the accessibility tree
548
- note: 'interactive_elements are empty: this client does not read the UI Automation tree',
549
- };
534
+ // the desktop's windows-use returns the UI Automation tree; so do we on Windows
535
+ const state = automation.state();
536
+ if (!state.ok) return state;
537
+ return state;
550
538
  }
551
539
 
552
540
  if (op === 'sysinfo') {
@@ -626,7 +614,7 @@ async function runUiAction(bridge, taskId, request, opts) {
626
614
  const dir = path.join(os.tmpdir(), 'arenacode-shots');
627
615
  fs.mkdirSync(dir, { recursive: true });
628
616
  const file = path.join(dir, `shot-${stamp()}.png`);
629
- const shot = automation.screenshot(file);
617
+ const shot = automation.screenshot(file, { annotate: Boolean(request.annotated) });
630
618
  if (!shot.ok) return shot;
631
619
  const buf = fs.readFileSync(shot.file);
632
620
  // the agent runs in the sandbox: the image travels through the bridge workspace
@@ -639,6 +627,7 @@ async function runUiAction(bridge, taskId, request, opts) {
639
627
  height: shot.height,
640
628
  file: remote || shot.file,
641
629
  local_file: shot.file,
630
+ annotated: Boolean(request.annotated),
642
631
  };
643
632
  if (buf.length <= 2 * 1024 * 1024) out.image = buf.toString('base64');
644
633
  return out;