From e49339bdab5dc03dadea005c9dcacbfff45b3ea5 Mon Sep 17 00:00:00 2001 From: dailz Date: Tue, 14 Jul 2026 10:32:43 +0800 Subject: [PATCH] docs(agents): update module paths after directory-form refactor Update the 'Runtime architecture' section to reflect that state.rs / cap_portal.rs / state_portal.rs / webrtc.rs are now parent modules of directory trees: - src/state.rs -> src/state/mod.rs (+ src/state/dispatch/ for the 13 Wayland Dispatch impls) - src/state_portal.rs still exists; helpers split into src/state_portal/{bitrate,threads}.rs - src/cap_portal.rs holds the struct; setup/token_fs/pipewire_thread split into src/cap_portal/ - src/webrtc.rs gains src/webrtc/html_page.rs sibling No content changes beyond the path references; the rest of AGENTS.md remains accurate. --- AGENTS.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index b408a3b..2715878 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -24,8 +24,8 @@ - `src/main.rs` is the real entrypoint: parse `Args`, initialize tracing from `RUST_LOG` or `-v`, reject non-H.264, require `--output` or `--port`, detect backend, then run one of two loops. - Backend detection in `src/backend_detect.rs`: explicit `--backend portal|screencopy` wins; otherwise wlr-screencopy is preferred when the Wayland global `zwlr_screencopy_manager_v1` exists, else Portal/PipeWire is used if D-Bus ScreenCast is available. - Do not use `ashpd` for backend availability checks; `backend_detect.rs` intentionally uses raw `zbus` because `ashpd` caches a `zbus::Connection` in a global and can hang after its owning Tokio runtime is dropped. -- `src/state.rs` drives the wlroots path using a mio Wayland fd loop and `State`; `src/state_portal.rs` drives the Portal/PipeWire path through `CapPortal` frame channels. -- `src/webrtc.rs` is a small embedded HTTP/WebRTC signaling server using `str0m`; `--port 0` means file-output mode, `--port > 0` enables WebRTC mode. +- `src/state/mod.rs` drives the wlroots path using a mio Wayland fd loop and `State` (Wayland `Dispatch` impls live under `src/state/dispatch/`); `src/state_portal.rs` drives the Portal/PipeWire path through `CapPortal` frame channels (bitrate helpers and encode/webrtc thread loops are split into `src/state_portal/{bitrate,threads}.rs`). `src/cap_portal.rs` holds the `CapPortal` struct itself; its setup logic, token filesystem helpers, and PipeWire capture thread live under `src/cap_portal/`. +- `src/webrtc.rs` is a small embedded HTTP/WebRTC signaling server using `str0m`; the embedded HTML test page is in `src/webrtc/html_page.rs`. `--port 0` means file-output mode, `--port > 0` enables WebRTC mode. ## Unsafe and FFI work