zcode-app-cli 3.9.1-16 → 3.9.2-16

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.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
3
  "name": "@zcode/zcode-cua-plugin",
4
- "version": "0.5.10",
4
+ "version": "0.5.12",
5
5
  "private": true,
6
6
  "description": "ZCode CUA plugin wrapper; its version tracks the upstream zcode-cua MCP server version (enforced by check-version-coherence.mjs against the pnpm catalog pin)",
7
7
  "license": "MIT",
@@ -12,18 +12,35 @@ Main agent only. Never delegate Computer Use to a subagent.
12
12
  Observe once, act once, then verify.
13
13
 
14
14
  1. If readiness is unknown, call `request_access` once.
15
- 2. Resolve the app with `list_apps`; use `open_application` only when needed.
15
+ 2. `list_apps` shows running apps only. If the user names an app that is absent,
16
+ use `open_application` once with the original user-provided name: copy it character-for-character,
17
+ including its script, case, spaces, punctuation, and suffixes such as `app`.
18
+ For example, use `{"name":"网易云音乐app"}`, not `{"name":"网易云音乐"}`;
19
+ use `{"name":"日历"}`, not `{"name":"Calendar"}`.
20
+ Do not translate, localize, normalize, shorten, or remove a suffix. Do not retry names,
21
+ operate Finder/Spotlight, use shell commands to discover it, or substitute a different running app.
16
22
  3. Call `get_app_state`. Start with the accessibility tree and no screenshot.
17
23
  4. If the target has an accessibility element, use an element action. This is the primary path because it is semantic, precise, background-safe, and does not steal the user's focus.
18
24
  5. Only when accessibility cannot locate or express the target, request a window
19
25
  screenshot or full screenshot and use a frame-bound coordinate action.
20
- 6. Prefer `return_state="compact"` when the action supports it. Otherwise observe
21
- again only when verification is required.
26
+ 6. Let actions return the default receipt only. Use `return_state="compact"` or
27
+ call `get_app_state` only when the next step needs fresh UI state.
22
28
 
23
29
  Do not run both the accessibility and visual workflows for the same action.
24
30
  Do not activate or focus an app merely to make a semantic action work.
25
31
  Honor tool capabilities and fail-closed results.
26
32
 
33
+ Tool failures are reported without a producer-side permission classifier. Read
34
+ the original message before choosing recovery. Call `request_access` once only
35
+ when the failure explicitly names Accessibility or Screen Recording; do not
36
+ infer macOS permission loss from a generic `permission_denied`, foreground,
37
+ focus-policy, UIPI, or capability failure. If delivery is `possibly_sent`,
38
+ observe the application state and never replay the same action automatically.
39
+ If `request_access` reports Accessibility as `denied`/`stale` or Screen Recording
40
+ as `denied`, tell the user that authorization is required and end the current
41
+ turn. Do not call another Computer Use action, retry `request_access`, or promise
42
+ that the interrupted action will continue automatically after authorization.
43
+
27
44
  ## Choose the target
28
45
 
29
46
  There are two authoritative target forms:
@@ -74,8 +91,31 @@ occlusion, permission, or capability refusal.
74
91
  A coordinate refusal may report that windows covering the point were skipped, or
75
92
  name an owner other than the app you expected. Those windows are invisible
76
93
  overlays belonging to the user's environment. Raise the window you meant to act on
77
- with `open_application(activate=true, confirm_focus_steal=true)`, observe again,
78
- and retry. Do not move, resize, or close the reported windows.
94
+ with `open_application(activate=true)`, observe again, and retry. Do not move,
95
+ resize, or close the reported windows.
96
+
97
+ ### macOS file panels
98
+
99
+ For an `open_panel` / `save_panel` exact-path workflow, background app-scoped
100
+ keyboard receipts may be accepted without executing the AppKit command. Use this
101
+ single recovery sequence:
102
+
103
+ 1. Observe the panel and keep its `pid`, `bundle_id`, and fresh `actual_window_id`.
104
+ 2. Call `open_application` with those three fields and `activate=true`.
105
+ 3. Observe the same panel again, then send Cmd+Shift+G with `strategy=event` and
106
+ that exact panel window id.
107
+ 4. Observe by `pid` / `bundle_id` **without the old panel `window_id`**, so CUA
108
+ returns the newly focused `attached_dialog`. Pin its fresh `actual_window_id`
109
+ for the path `type(strategy=event)` and Enter.
110
+
111
+ `key` and `type` never activate implicitly. If they return `foreground_required`
112
+ with `action_sent=false`, repeat the confirmed activation and fresh observation;
113
+ do not retry the same key blindly. Ordinary windows and popovers do not receive
114
+ this activation exception.
115
+
116
+ For every ordinary launch or application activation, omit `window_id`. Never
117
+ invent a window id or use a placeholder such as `1`. If `bundle_id` or `pid` is
118
+ known, pass that canonical identity without a translated or guessed `name`.
79
119
 
80
120
  ## Text and keyboard
81
121
 
@@ -98,13 +138,16 @@ Platform app references:
98
138
  ## Outcome and retry safety
99
139
 
100
140
  `action_sent=true` means the action may already have happened. Never blindly
101
- replay it. Retry a non-idempotent action only when `action_sent=false`.
102
-
103
- Use returned post-state or a fresh `get_app_state` to verify the result. Old
104
- `state_id` values become stale after an element write. When
105
- `state_sync_status="refresh_required"`, call `get_app_state` before another
106
- element write. A changed tree is not by itself proof that this action caused the
107
- change; prefer target-specific verification fields when present.
141
+ replay it. When `action_sent=false`, re-observe with `get_app_state`, choose a
142
+ fresh target from the new state, and issue a new action only if it is still
143
+ needed. Never replay the same stale action call.
144
+
145
+ The default action result is an `action_receipt`, not a UI observation. Old
146
+ `state_id` values used by a sent element write are consumed after dispatch; call
147
+ `get_app_state` before another element write or whenever the next step depends
148
+ on current UI state. A changed tree is not by itself proof that this action
149
+ caused the change; verify with the app state or an external task oracle when it
150
+ matters.
108
151
 
109
152
  Call `stop_computer_control` to stop the active control session. Do not continue
110
153
  after the kill switch, denied access, or a non-retryable readiness result.