mirror of
https://github.com/callstack/agent-device.git
synced 2026-09-14 20:06:34 +08:00
3c09bb2566
* fix(daemon): reject unsupported raw --save-script flags at request ingress `flags.saveScript` arms session-script publication the moment a successful handler records the request's action, so any recordable command reaching a handler with the raw flag set could arm publication and write a `.ad` artifact — `record stop` immediately through record-only cleanup, `trace` and the interaction commands later on close. The CLI/Node/MCP surfaces only emit the flag for its released owners, so that arming path was reachable only by a hand-built wire request or a free-form `batch` step. Close it at the daemon request seam (`createRequestHandler`), the single entry point both the socket and HTTP transports funnel through, and ahead of admission, session lookup, device resolution, and handler dispatch. Ownership is declared on the command descriptor (`saveScriptFlagOwner`) rather than re-stated as a string set, so `open`, `close`, and `replay` keep the flag and everything else is rejected with an ADR 0010 shaped `INVALID_ARGS` carrying a hint, diagnosticId, and logPath. With that path pinned closed, a record-only session can no longer carry `recordSession`, so `record stop`'s immediate `writeSessionLog` could only ever be a no-op; delete it. Refs #1478. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RXQLYV7etZx3gcXsUsrQJ8 * test(daemon): assert ADR 0010 diagnostics on save-script rejection The HTTP test helper projected only code/message/hint, so `diagnosticId` and `logPath` could regress while the transport tests stayed green. Preserve both in the helper and assert on each transport that `diagnosticId` is present, `logPath` is present and exists, and the log records `save_script_flag_rejected`. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RXQLYV7etZx3gcXsUsrQJ8 --------- Co-authored-by: Claude <noreply@anthropic.com>
5.4 KiB
5.4 KiB
Changelog
Unreleased
--save-scriptis now accepted only by the commands that declare it —open,close, andreplay. A hand-built daemon request (or abatchstep) that setsaveScripton any other command, such asrecordortrace, used to arm script publication and could write a.adartifact; it is now rejected withINVALID_ARGSbefore the request reaches admission, the device, or any handler. CLI, Node, and MCP usage of--save-scripton its documented commands is unchanged.diff screenshotno longer runs the retired best-effort OCR and non-text analyzers. Their optionalocrandnonTextDeltasfields remain in the result type for source compatibility but are no longer emitted; use the baseline/current images and diff artifact with vision for qualitative interpretation.- Breaking: removed the deprecated
--session-lockedand--session-lock-conflictsflags. Use--session-lock reject|stripinstead; passing either old flag now fails withUnknown flag: ... Use --session-lock reject|strip instead. - Breaking: removed the
replay export --formatflag.replay exportalways writes Maestro YAML. - Breaking: removed the unused
LeaseAllocatePayload,LeaseHeartbeatPayload, andLeaseReleasePayloadtype exports fromagent-device/contracts. Lease request metadata is fully described byDaemonRequestMeta. - Maestro compat:
assertVisibleandassertNotVisiblenow acceptchildOffor ancestor scoping, matchingtapOn(#1294). - Breaking: removed deprecated gesture duration and rotate velocity inputs (#1218).
swipe x1 y1 x2 y2no longer accepts a trailingdurationMspositional; usegesture pan x1 y1 (x2-x1) (y2-y1) durationMsfor deliberate timed drags.- Maestro
swipeoperations with a duration continue to normalize togesture panwith theendpoint-holdexecution profile, preserving the Maestro-compatible fast-swipe-then-hold behavior on iOS. gesture fling direction x yno longer accepts a trailingdurationMspositional; usegesture panfor timed movement.gesture swipe presetno longer accepts a trailingdurationMspositional; usegesture panfor timed movement.gesture rotate degrees [x] [y]no longer accepts a trailingvelocitypositional; rotation pacing is derived fromdegrees.- MCP/Node schemas no longer advertise
velocityordurationMsonswipe/fling/gesture swipe;durationMsremains ongesture panandgesture transform. - A
.adscript that still carries a removed positional now fails when the script is parsed, before the replay executes any device action, naming the line and its rewrite (for exampleswipe accepts 4 arguments: x1 y1 x2 y2 (line 6). The trailing durationMs positional was removed: use "gesture pan 197 650 0 -350 300" ...). Previously the script ran up to that step and then failed as a replay divergence. - Published the gesture migration guide covering CLI, Node.js, MCP, and saved
.adrecordings, plus the deprecation policy the next such removal follows (#1216). replay exportnow writes an explicitduration: 100forswipe— the canonical fling duration — instead of omitting it and letting Maestro apply its own 400ms default. Maestro flows replayed byagent-deviceare unaffected; a timed Maestroswipestill normalizes togesture panwith theendpoint-holdprofile.
- Breaking: the deprecated
rotateCLI command alias has been removed. Useorientationinstead; invokingrotatenow fails withrotate was renamed to orientation; for the two-finger gesture use: gesture rotate. - Breaking (ADR 0014, session ref-frame lifetime): a mutation through an
@refnow expires the session's ref frame, so a later ref mutation without a fresh observation fails closed with a typeddetails.reason(ref_frame_expired,ref_generation_mismatch,plain_ref_requires_complete_frame, orref_not_issued) instead of acting on a possibly-navigated screen. A ref-oriented sequence that performs several mutations must re-snapshotbetween them, consume an honestly issued--settleref in pinned@eN~s<gen>form, or use selectors. Enforcement applies on every platform, not just iOS. Legacy hand-written.adscripts that reuse several bare refs from one snapshot must capture between mutations or use selectors. - Ref reads resolve against the authorized ref frame's source tree, so an internal read-only capture (including Android freshness) can no longer retarget an admitted
@refby positional coincidence. Read-only ref consumers keep the structured staleness warning while the frame retains the ref's evidence.
0.15.0
- Breaking:
appsdiscovery and public app-list helpers now default to user-installed apps. Use--allorfilter: 'all'to include system/OEM apps. - Breaking: removed the
agent-device/android-appspublic subpath. Use the Android app helpers fromagent-device/android-adb. - Breaking: removed the
agent-device/daemonpublic subpath. Useagent-device/contractsfor daemon request/response types. - Breaking: removed public local ADB bypass/selection helpers such as
spawnAndroidAdbBySerialandresolveAndroidAdbProvider; usecreateLocalAndroidAdbProvider(device)or pass providers directly to the helpers fromagent-device/android-adb. - Added Android ADB provider helpers for exec, stream, clipboard, keyboard, app lifecycle, logcat, and port reverse workflows.