mirror of
https://github.com/lahfir/agent-desktop.git
synced 2026-08-05 21:48:45 +00:00
Lands the last set of ABI-shape changes before the header is published. Any addition after publication would be a breaking change for every consumer linked against the old layout. Core / platform additions: - crates/core/src/adapter.rs: new `PlatformAdapter::release_handle` trait method with `not_supported()` default. macOS implementations must `CFRelease` the underlying AXUIElementRef to balance the CFRetain that happened during resolve. Windows/Linux inherit the default unchanged. - crates/macos/src/adapter.rs: macOS impl calls `core_foundation::base::CFRelease(raw)` when the raw pointer is non-null. FFI surface additions: - crates/ffi/src/types/snapshot_surface.rs: new AdSnapshotSurface enum (Window=0, Focused, Menu, Menubar, Sheet, Popover, Alert) mirroring the 7-variant core SnapshotSurface. - crates/ffi/src/types/tree_options.rs: new `surface: AdSnapshotSurface` field. Previous hard-coded SnapshotSurface::Window is replaced by consumer-selected surface with enum-validated read at entry. - crates/ffi/src/windows/list.rs: ad_list_windows gains `focused_only: bool` between app_filter and out — maps directly to WindowFilter::focused_only. Consumers can now call `ad_focused_window`- style queries without a second ABI round. - crates/ffi/src/actions/native_handle.rs: new `ad_free_handle(adapter, handle)` exported. Null-tolerant on both sides; Windows/Linux `ActionNotSupported` is translated to `Ok` so C consumers can call the release path uniformly across platforms. Validation: - AdSnapshotSurface added to enum_validation.rs — ad_get_tree now rejects invalid surface discriminants with `AD_RESULT_ERR_INVALID_ARGS` rather than matching on UB. Closes R5, R9, R10 from PR #22 review. 52 lib tests pass, 1 integration test passes. Clippy clean. |
||
|---|---|---|
| .. | ||
| core | ||
| ffi | ||
| linux | ||
| macos | ||
| windows | ||