Implementation and validation
Doc status: history. The Rust/Iced prototype was removed on 2026-10-30; see web-shell-development.md. Checked 2026-11-10.
History. The Rust/Iced prototype described here was removed from the repository on 2026-10-30; the code remains available in commit
f615cab.
Later direction: customizable web shell, with River chosen and the current implementation. References below to Flutter as the main UI and to Mutter as a priority are historical.
Record of 2026-10-25. POC 1 integrates a real agent with headless OpenCode. External windows are represented by placeholders; there is no embedded application content. The explicit decision of the project owner replaces the initial version, which used keyword interpretation.
Running
Requires Rust 1.88+, OpenCode on the PATH and OpenRouter authenticated through opencode auth login. Validated with Rust 1.98.1, OpenCode 1.19.4 and macOS ARM64. The minimum Rust version and the Linux/Windows runtimes are not yet validated.
cargo run --locked
On macOS, ./scripts/macos-app.sh produces target/AgentNativeOS.app, an unsigned local bundle. The app looks for the OpenCode executable on the PATH and in ~/.local/bin/opencode. AGENT_NATIVE_OPENCODE_BIN sets another path without changing the global configuration.
Wait for the Ready indicator. Send the suggestion to prepare the development environment. The intent goes to the LLM and does not match a hardcoded command. The behavior depends on the real response of the model.
The app pins openrouter/nvidia/nemotron-3.5-lightning:free, including the helper model. There is no fallback to paid models or to a simulated agent. Quotas, connection and authentication can block execution and appear as errors in the UI.
Minimal architecture
domain.rs: portable Desktop, workspaces, windows and activities. No dependency on UI or transport.executor.rs: typed tools, argument validation, IDs and active workspace scope. Returns the state that was actually applied.runtime.rs: OpenCode process owned by the app, HTTP/SSE client, sessions and MCP bridge.main.rs: Iced shell, activities, progress/approval/error states and the executor in the main loop.stage.rs: canvas, hit testing, clipping and geometry interpolation.
An intent creates an activity and an OpenCode session, and also records the affected workspaces. The agent queries the state and chooses the tools. OpenCode calls the MCP bridge; the bridge hands the call to the Iced loop, which validates it, applies it and answers the agent. SSE events update the progress. Completion and cost come from the real session.
The app does not implement a second LLM loop. The inference runtime, the session history and tool calling belong to OpenCode.
Tools and authority
The bridge exposes only get_state, create_workspace, switch_workspace, add_window, focus_window, close_window, move_window, resize_window and organize_windows.
Creating a workspace returns an empty context; the agent decides to create an editor, a terminal and a browser. The executor checks the changes before it answers. There is no access to files, shell, a real browser or operating system APIs. Home is a manual control, with no tool for the agent in this milestone.
The OpenCode server and the MCP bridge listen only on loopback and on ephemeral ports. Distinct, ephemeral tokens protect the bridge and the API. Provider credentials stay in the existing OpenCode storage; they are not copied into the repository. The isolated configuration enables only OpenRouter and the simulator bridge. Unexpected global MCP integrations make startup fail.
A close requested by the agent requires approval. The UI offers Allow once/Deny and forwards the decision to OpenCode. Deny also cancels the activity and keeps the changes already applied. Manual user controls do not need agent approval.
Cancellation and resume
Cancel activity, Home or manual geometry changes cancel the current activity. Changes already applied are kept; there is no implicit rollback. Calls already delivered with the ID of a canceled activity, or with an expired response, are rejected. A retry must inspect the real state through get_state.
The OpenCode process created by the app ends when the app closes. No external server and no session from another chat ends. The visual state and the activity mapping stay only in memory in this POC; the sessions remain subject to the OpenCode storage policy. There is no automatic resume after a restart.
The execution has a 180-second deadline. The UI shows API/SSE errors, authentication/quota errors and a missing executable. There is no automatic switch of provider or model.
Validation
cargo fmt --check
cargo test --locked
cargo clippy --locked --all-targets -- -D warnings
cargo build --locked
Local suite: 20 tests passed; two live tests are ignored by default to avoid recurring network calls.
The tests cover domain, limits and isolation, the typed executor, rejection of out-of-context operations, fragmented/UTF-8/CRLF SSE parsing, MCP authentication, absence of fallback, late calls after cancellation, approval states and canvas input.
Real integration, run separately:
cargo test --locked live_free_agent_prepares_desktop -- --ignored --nocapture
cargo test --locked real_agent_requires_approval_before_close -- --ignored --nocapture
Both passed with the pinned free model. The first proved workspace creation, three window types, organization and focus through real tool calls. The second proved that a close waits for approval before it removes the window. The sessions reported cost 0. The headless process ended when the tests finished.
The first attempt of the agent called a Home tool by mistake after it prepared the environment. That tool was removed from the surface available to the agent, and the real-state test passed after the change. Home remains available manually.
Current limits
- Only the macOS runtime is validated. Hyprland and real application control remain for later.
- Placeholders represent functions of external applications. There is no embedded editor, terminal, browser or notes, and no installed executable picker in this milestone.
- Drag/resize have event tests; the earlier native automation did not prove manual movement. Interactive validation of these operations is still pending.
- Minimum layout of 900 × 640 points. The switch between empty and active composition is immediate; the surface geometry is interpolated.
- No voice, attachments, visual persistence, custom shaders or complete canvas accessibility.
- Detailed instrumentation of CPU, GPU, memory and latency remains pending.
- The transitive dependency block 0.1.6 emits a future-compatibility warning; the current build passes.
- The original image reference was not accessed; the design follows the textual description.
Visual evidence
The screenshots of the first deterministic version are historical and do not prove the real integration: earlier start, earlier workspace.
Check of the OpenCode version in the native window: Ready, real preparation intent, seven tool calls, result with reported cost zero, approval requested to close a terminal, and a refusal that kept the window with activity Cancelled. The second intent, on the existing windows, completed four real tool calls, focused the editor and moved the terminal within the simulator limits.
Media stays out of Git and uses synthetic data. The uploads were confirmed by head-object and the public GETs returned valid PNGs. This does not prove inline rendering in the chat. Historical evidence of the integration, from before the adjustment to placeholders for external applications:
Sources
Context had no installed coverage of the relevant libraries. The following were consulted: Iced 0.14, OpenCode server, MCP in OpenCode, Axum 0.8 and the sources of the crates resolved in Cargo.lock (reqwest 0.12.28 and axum 0.8.9). The real session, SSE and approval calls confirmed the installed contract.
Scope adjustment: window manager
Removed the fake code, terminal output and page from the canvas. Each window identifies only the function of an external application. The agent prompt limits its authority to the organization of windows and workspaces; development stays in the application the user chooses. The suggestion to review bugs was replaced by a focus and position operation.
The next milestone is to validate the Hyprland adapter on Linux: query existing windows and apply focus/position/size using real IDs. The selection and opening of applications must respect the preferences of the user, without imposing development tools. This backend is not yet implemented or validated.
Git flow: publish commits directly to main after validation, without a PR, as the project owner directed. The implementation continues in a dedicated worktree to preserve the main checkout.