@agentconnect.md/computer 2.8.0-rc.25 → 2.8.0-rc.38

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.
@@ -82903,6 +82903,8 @@ var MAC_COMMAND_KEYS = /* @__PURE__ */ new Set(["cmd", "command", "meta"]);
82903
82903
  var HUMAN_POLL_MS = 500;
82904
82904
  var MAX_TYPE_CHARS = 4096;
82905
82905
  var TYPE_REMAP_PAUSE_MS = 40;
82906
+ var VIEWER_SESSION = "viewer";
82907
+ var VIEWER_SESSION_REFRESH_MS = 4 * 6e4;
82906
82908
  var Computer = class {
82907
82909
  driver;
82908
82910
  config;
@@ -82929,6 +82931,8 @@ var Computer = class {
82929
82931
  // `by` is set when a remote human took over through the web viewer.
82930
82932
  paused;
82931
82933
  capture;
82934
+ // `cursor` is false where the driver refuses cursor settings (macOS has no overlay).
82935
+ viewerCapture;
82932
82936
  queue = Promise.resolve();
82933
82937
  busy = false;
82934
82938
  actions = 0;
@@ -83065,18 +83069,20 @@ var Computer = class {
83065
83069
  this.assertViewerControl(client);
83066
83070
  await this.exclusive(async () => {
83067
83071
  this.assertViewerControl(client);
83068
- if (!this.captureIsCurrent()) await this.captureScreen();
83069
- const { width, height } = this.capture;
83072
+ const { width, height } = await this.viewerSessionCapture();
83070
83073
  const px = (point) => ({
83071
83074
  x: Math.round(Math.min(Math.max(point.x, 0), 1) * (width - 1)),
83072
83075
  y: Math.round(Math.min(Math.max(point.y, 0), 1) * (height - 1))
83073
83076
  });
83074
- const call = viewerCall(input2, px);
83077
+ const viewer = viewerCall(input2, px);
83078
+ const call = { ...viewer, args: { ...viewer.args, session: VIEWER_SESSION } };
83075
83079
  this.assertViewerControl(client);
83076
83080
  await this.callDriver(call, () => {
83077
83081
  this.assertAuthorized();
83078
83082
  this.assertViewerControl(client);
83079
83083
  });
83084
+ if (this.viewerCapture?.cursor)
83085
+ await this.driver.call("set_agent_cursor_enabled", { session: VIEWER_SESSION, enabled: false });
83080
83086
  });
83081
83087
  if (input2.type !== "move")
83082
83088
  this.audit({ client, tool: `viewer_${input2.type}`, args, outcome: "ok", ms: this.now() - started });
@@ -83585,6 +83591,48 @@ var Computer = class {
83585
83591
  }
83586
83592
  return result;
83587
83593
  }
83594
+ // Sets up the viewer session (no glide, then a capture that maps its coordinates) whenever the driver may have lost it.
83595
+ async viewerSessionCapture() {
83596
+ const now = this.now();
83597
+ const current = this.viewerCapture;
83598
+ if (current?.generation === this.driver.generation() && now - current.usedAt < VIEWER_SESSION_REFRESH_MS) {
83599
+ current.usedAt = now;
83600
+ return current;
83601
+ }
83602
+ const session = VIEWER_SESSION;
83603
+ await this.driver.call("start_session", { session });
83604
+ let cursor = true;
83605
+ try {
83606
+ await this.driver.call("set_agent_cursor_motion", {
83607
+ session,
83608
+ timing: "fixed",
83609
+ glide_duration_ms: 1,
83610
+ dwell_after_click_ms: 0,
83611
+ effects: { glow: "off", ripple: "off", squish: "off", trail: "off", magnet: "off" }
83612
+ });
83613
+ } catch (error63) {
83614
+ const refusal = error63 instanceof DriverToolError ? error63.result.structuredContent?.refusal : void 0;
83615
+ if (refusal?.code !== "facility_unavailable") throw error63;
83616
+ cursor = false;
83617
+ }
83618
+ const result = await this.driver.call("get_desktop_state", {
83619
+ max_image_dimension: this.config.maxImageDimension,
83620
+ session
83621
+ });
83622
+ const meta3 = result.structuredContent ?? {};
83623
+ const num = (key) => typeof meta3[key] === "number" ? meta3[key] : 0;
83624
+ this.viewerCapture = {
83625
+ generation: this.driver.generation(),
83626
+ width: num("screenshot_width"),
83627
+ height: num("screenshot_height"),
83628
+ screenWidth: num("screen_width"),
83629
+ screenHeight: num("screen_height"),
83630
+ scale: num("scale_factor") || 1,
83631
+ usedAt: now,
83632
+ cursor
83633
+ };
83634
+ return this.viewerCapture;
83635
+ }
83588
83636
  captureIsCurrent() {
83589
83637
  return this.capture !== void 0 && this.capture.generation === this.driver.generation();
83590
83638
  }
@@ -87124,7 +87172,7 @@ var serviceEntry = () => managedEntry() ?? resolve2(process.argv[1]);
87124
87172
 
87125
87173
  // src/version.ts
87126
87174
  init_define_AGENTCONNECT_COMPUTER_WINDOWS_SOURCES();
87127
- var COMPUTER_DAEMON_VERSION = true ? "2.8.0-rc.25" : JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf8")).version;
87175
+ var COMPUTER_DAEMON_VERSION = true ? "2.8.0-rc.38" : JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf8")).version;
87128
87176
 
87129
87177
  // src/http-server.ts
87130
87178
  var CONTROL_HEADER = "x-agentconnect-computer";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentconnect.md/computer",
3
- "version": "2.8.0-rc.25",
3
+ "version": "2.8.0-rc.38",
4
4
  "description": "AgentConnect computer daemon: drives a desktop through Cua Driver and serves the computer_* tools over MCP; installed and upgraded by agentconnect computer",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {