Add agentic RDP CLI and localhost CI workflow#1289
Add agentic RDP CLI and localhost CI workflow#1289Marc-André Moreau (mamoreau-devolutions) wants to merge 2 commits into
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Nice to see this drop. Doing a first read; the |
| let snapshot = self.snapshot.read().await; | ||
| let mouse_position = self.input_database.lock().await.mouse_position(); | ||
|
|
||
| SessionSummary { | ||
| session_id: self.session_id.clone(), | ||
| status: snapshot.status.clone(), | ||
| width: snapshot.frame.as_ref().map(|frame| frame.width), | ||
| height: snapshot.frame.as_ref().map(|frame| frame.height), | ||
| frame_sequence: snapshot.frame_sequence, | ||
| mouse_x: mouse_position.x, | ||
| mouse_y: mouse_position.y, | ||
| last_error: snapshot.last_error.clone(), |
| if self.has_requested_frame(after_frame).await { | ||
| return Ok(()); | ||
| } | ||
|
|
||
| tokio::time::timeout(timeout, async { | ||
| loop { | ||
| self.notify.notified().await; | ||
|
|
||
| if self.has_requested_frame(after_frame).await { | ||
| break; | ||
| } |
| let listener = | ||
| tokio::net::UnixListener::bind(&path).with_context(|| format!("failed to bind {}", path.display()))?; | ||
|
|
| (None, Some(env_name)) => { | ||
| let password = | ||
| std::env::var(env_name).with_context(|| format!("failed to read password from {env_name}"))?; | ||
| args.push("--password".to_owned()); | ||
| args.push(password); | ||
| } |
| session | ||
| .input_sender | ||
| .send(RdpInputEvent::Close) | ||
| .map_err(|_| ApiError::new(StatusCode::CONFLICT, "session input channel is closed"))?; |
| [string] $AgentPath = (Join-Path $env:GITHUB_WORKSPACE 'target\release\ironrdp-agent.exe'), | ||
|
|
||
| [string] $Endpoint = "pipe:ironrdp-agent-ci-$PID", | ||
|
|
||
| [string] $ArtifactsDir = (Join-Path $env:GITHUB_WORKSPACE 'artifacts\agentic-rdp'), |
| param( | ||
| [Parameter(ParameterSetName = 'Enable')] | ||
| [Parameter(ParameterSetName = 'Cleanup')] | ||
| [string] $StatePath = (Join-Path $env:RUNNER_TEMP 'ironrdp-agentic-rdp-state.json'), |
| Set-ItemProperty -Path $terminalServerPath -Name 'fDenyTSConnections' -Value 0 | ||
| Set-ItemProperty -Path $rdpTcpPath -Name 'UserAuthentication' -Value 0 | ||
| Set-Service -Name TermService -StartupType Automatic | ||
| Start-Service -Name TermService | ||
| Enable-NetFirewallRule -DisplayGroup 'Remote Desktop' | Out-Null |
| [Parameter(ParameterSetName = 'Register')] | ||
| [Parameter(ParameterSetName = 'RunServer')] | ||
| [Parameter(ParameterSetName = 'Wait')] | ||
| [string] $EndpointPath = (Join-Path $env:GITHUB_WORKSPACE 'artifacts\agentic-rdp\pshost-endpoint.json'), | ||
|
|
| [string] $EndpointPath = (Join-Path $env:GITHUB_WORKSPACE 'artifacts\agentic-rdp\pshost-endpoint.json'), | ||
|
|
||
| [string] $ArtifactsDir = (Join-Path $env:GITHUB_WORKSPACE 'artifacts\agentic-rdp') | ||
| ) | ||
|
|
||
| Set-StrictMode -Version Latest | ||
| $ErrorActionPreference = 'Stop' | ||
|
|
|
Further thoughts... Marc-André Moreau (@mamoreau-devolutions), the embedding refactor in
Aside: #790 has me and Benoît Cortier (@CBenoit) converging on a layered embedding for the WASM side. I built an ~4,600 LOC lamco-rdp-wasm (worker-thread + WebCodecs + EGFX); we're putting |
There was a problem hiding this comment.
Nice feature enabling interesting use cases.
A few high level observations:
ironrdp-clientis not intended to be used as a library, but it is used as such byironrdp-agent- Integration with
rdpsndwas added toironrdp-clientas part of this PR, but is not directly related to the agentic RDP CLI - I would not gate
rdpsndbehind a compile-time feature flag; it’s something we want to have by default. - Agentic RDP CI scripts living in a
testing/folder at the root of the project is slightly polluting the workspace.
Suggestions:
- Add support for
rdpsndin a dedicated PR - Add support for desktop size CLI in a dedicated PR
- Separate the
ironrdp-clientcrate into two crates:ironrdp-client(library) andironrdp-viewer(binary only, equivalent to totay’sironrdp-client).- Keep the refactoring with
RdpOutputEventSendertrait as a way to abstract the RDP output events.
- Keep the refactoring with
- In the current PR:
- Keep agentic RDP related changes
- Move the Agentic RDP CI scripts somewhere into
.github/folder
I can handle most of that, and we can shrink this PR significantly
|
Benoît Cortier (@CBenoit) I can leave this PR in your hands if you can handle most of it |
Summary
ironrdp-agent, a daemon-backed CLI for agentic/headless RDP automation over local IPC.rdpfiles, logging controls, and--desktop-size WxHironrdp-agent, verifies PSRemoting, and uploads screenshot/log artifactsValidation
cargo check -p ironrdp-agentcargo test -p ironrdp-agentcargo clippy -p ironrdp-agent --all-targets -- -D warningscargo xtask check fmt -vcargo test -p ironrdp-agent --test ipc26121877104127.0.0.1:33891920x1080framebufferNotes
Full workspace
cargo xtask check lints -v/cargo xtask check tests --no-run -vwere blocked locally by the existing Windowslibopus_sysCMake generator issue (Visual Studio 18 2026), unrelated to the agent crate path.