ucu-mcp 0.6.7 → 0.6.8

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.
@@ -445,11 +445,17 @@ export async function typeText(text, delay = 20, _platform = process.platform, t
445
445
  }
446
446
  flushCG();
447
447
  flushFallback();
448
- // Process each batch
448
+ // Process each batch — track the dispatch method used (worst-case wins: hid-tap > per-pid).
449
+ let lastDispatch;
449
450
  for (const batch of batches) {
450
451
  if (batch.cgEvent && Array.isArray(batch.chars)) {
451
452
  if (isCgeventAvailable() || isSkylightAvailable()) {
452
- runInputChecked({ command: "typeBatch", keys: batch.chars }, target);
453
+ const d = runInputChecked({ command: "typeBatch", keys: batch.chars }, target);
454
+ // If any batch went hid-tap, the overall result is hid-tap.
455
+ if (d === "hid-tap")
456
+ lastDispatch = "hid-tap";
457
+ else if (lastDispatch !== "hid-tap")
458
+ lastDispatch = d;
453
459
  }
454
460
  else {
455
461
  // Build a single JXA script that types all chars in this CGEvent batch
@@ -485,7 +491,7 @@ export async function typeText(text, delay = 20, _platform = process.platform, t
485
491
  ], { timeout: 5000 });
486
492
  }
487
493
  }
488
- return;
494
+ return lastDispatch;
489
495
  }
490
496
  if (_platform === "linux") {
491
497
  await execFileAsync("xdotool", [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ucu-mcp",
3
- "version": "0.6.7",
3
+ "version": "0.6.8",
4
4
  "description": "MCP server for Universal Computer Use — desktop automation for AI agents via Model Context Protocol",
5
5
  "type": "module",
6
6
  "bin": {