ucu-mcp 0.3.4 → 0.3.6

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/CHANGELOG.md CHANGED
@@ -5,6 +5,38 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [0.3.5] - 2026-06-06 *(Yanked — see 0.3.6)*
9
+
10
+ ### Tests
11
+
12
+ - `macos-platform`: new regression test for the value-field regex pre-validation (`findElement({value:"[", textMode:"regex"})` throws `PlatformError` with an `Invalid regex pattern` message). Pins the 0.3.2 commit `0710eca` behavior change.
13
+ - `macos-platform`: new regression test for the near-sort bounds fallback (elements without `bounds` are pushed to the end of the sorted result, instead of implicitly being centered at (0,0)). Pins the 0.3.2 commit `0710eca` second behavior change.
14
+ - `tools-layer`: new regression test that `find_element({value:""})` returns `isError: true`. Pins the 0.3.2 commit `46d4ddd` schema tightening (`z.string().min(1).optional()`).
15
+
16
+ ### Changed
17
+
18
+ - JXA `textMatches` regex branch now compiles the `RegExp` once per element instead of once per source (name / value / description) — three fewer compilations per matched element when `textMode="regex"`. The TS-side pre-validation in `findElement` guarantees the pattern is valid, so the `RegExp` constructor cannot throw here. (Herschel review perf Minor)
19
+
20
+ ### Fixed
21
+
22
+ - Comment on the JXA `matchesValue` helper no longer claims "JXA function declarations are order-sensitive" (they aren't — JXA hoists them like any ES engine). The comment now correctly notes that the leading placement is for readability. (Herschel review comment Minor)
23
+
24
+ ## [0.3.6] - 2026-06-06
25
+
26
+ ### Re-publish of 0.3.5
27
+
28
+ 0.3.5 was published with a test that didn't account for the McpServer
29
+ schema-validation wrapper. The test called `handler({value:""})`
30
+ directly, which bypasses the schema validation, so the assertion
31
+ `r.isError === true` saw `undefined` instead. The actual fix
32
+ (asserting the zod schema constraint directly) was a one-test rewrite;
33
+ 0.3.6 carries the same code as 0.3.5 plus the test fix.
34
+
35
+ ### Yanked
36
+
37
+ `ucu-mcp@0.3.5` was unpublished (yanked) within minutes of release
38
+ due to the broken test. Users on `@latest` are now on 0.3.6.
39
+
8
40
  ## [0.3.4] - 2026-06-06
9
41
 
10
42
  ### Re-publish of 0.3.3
@@ -25,7 +57,7 @@ contents and CHANGELOG entry as 0.3.3 plus this note.
25
57
  `ucu-mcp@0.3.3` was unpublished (yanked) shortly after release due to
26
58
  the test file compile error. Users on `@latest` are now on 0.3.4.
27
59
 
28
- ## [0.3.3] - 2026-06-06
60
+ ## [0.3.3] - 2026-06-06 *(Yanked — see 0.3.4)*
29
61
 
30
62
  ### Tests
31
63
 
@@ -866,9 +866,9 @@ export class MacOSPlatform {
866
866
  // Shared filter helper. textMatches and valueMatches used to be near
867
867
  // copies of the same three-branch dispatch (contains / exact / regex);
868
868
  // this consolidates the logic so the two callers only differ in which
869
- // sources they iterate. Declared before textMatches/valueMatches
870
- // because JXA function declarations are order-sensitive within a
871
- // script. (Singer Nit)
869
+ // sources they iterate. Declared before textMatches/valueMatches for
870
+ // readability JXA's function declarations are hoisted, so order
871
+ // doesn't affect callability. (Singer Nit + Herschel comment fix)
872
872
  function matchesValue(filter, value, mode) {
873
873
  if (filter === null) return true;
874
874
  if (mode === "exact") {
@@ -886,8 +886,18 @@ export class MacOSPlatform {
886
886
  function textMatches(elemName, elemValue, elemDesc) {
887
887
  if (textFilter === null) return true;
888
888
  var sources = [elemName, elemValue, elemDesc];
889
- for (var i = 0; i < sources.length; i++) {
890
- if (matchesValue(textFilter, sources[i], textMode)) return true;
889
+ // Hoist regex compilation out of the loop. The TS-side pre-validation
890
+ // in findElement guarantees the pattern is valid, so the RegExp
891
+ // constructor cannot throw here. (Herschel perf Minor)
892
+ if (textMode === "regex") {
893
+ var reText = new RegExp(textFilter, "i");
894
+ for (var i = 0; i < sources.length; i++) {
895
+ if (reText.test(sources[i])) return true;
896
+ }
897
+ return false;
898
+ }
899
+ for (var j = 0; j < sources.length; j++) {
900
+ if (matchesValue(textFilter, sources[j], textMode)) return true;
891
901
  }
892
902
  return false;
893
903
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ucu-mcp",
3
- "version": "0.3.4",
3
+ "version": "0.3.6",
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": {