Skip to content

computer use: its own crate incord-desktop, with the incu MCP server (phase 1) - #93

Merged
blockmandev merged 1 commit into
mainfrom
feat/incord-desktop-crate
Nov 13, 2026
Merged

blockmandev merged 1 commit into
mainfrom
feat/incord-desktop-crate

Conversation

@blockmandev

Copy link
Copy Markdown
Member

Phase 1 of the computer-use split the owner asked for: the code moves out of incode into its own crate, so other projects can use it without incode. It's a move only. The behaviour and the 16-tool surface are unchanged; new functions (from atticus-mac) and record/replay come in later phases.

What changed

  • New crate crates/desktop: package incord-desktop, lib incord_desktop, binary incu. Everything from src/desktop/** moved with git mv: capture, journal, limits, safety, the MCP server, UIA/Win32, macOS, X11.
  • The three couplings to incode are cut:
    • Permissions: a crate-owned Tier (observe/act/deny) with the 5 observing and 11 acting tools.
    • Hooks: a Hooks trait; incode hands in its own HookRunner, and standalone incu uses a small built-in ShellHooks.
    • Config and folders: a crate-owned Config that reads incode's admin.json keys through aliases, and std::fs::create_dir_all.
  • incode --desktop-mcp stays, as a thin wrapper, so agent configs and installers don't change.
  • src/desktop.rs re-exports the crate, so every existing crate::desktop::* path compiles untouched.
  • New command incu serve [--tier observe|act|deny] [--journal] [--config] [--display] (-p kept as an alias), plus incu stop.
  • Doc drift fixed: the docs said "twelve" tools; there are 16.
  • CI: clippy and tests for incord-desktop, the Linux release ldd check covers incu, the Xvfb live test points at the crate, and the release tag check covers 3 crates. Shipping incu in release archives and installers is left for a later phase.

Verified (Windows)

  • fmt and clippy -D warnings (workspace) are clean.
  • cargo test --workspace: incode lib 2284 + bin 59; incord-desktop 195, 30 of them new (hooks, permission, config, cli); incord-sandbox all green.
  • A new test checks the crate's Tier against incode's PermissionPolicy::for_desktop for all 5 modes and all 16 tools: same verdict, same refusal text.
  • incu driven as an MCP client would drive it: initialize answers, and tools/list gives all 16 tools.
  • incord-desktop passes cargo check and clippy for aarch64-apple-darwin and x86_64-unknown-linux-musl (cross targets). Incode itself was not built for those here (no C toolchain), so this CI run is the macOS/Linux proof.

One behaviour note: a tool name outside the 16 is now refused by the tier ("requires approval…") instead of reaching the dispatcher as "unknown tool".

src/desktop/ moves whole to crates/desktop (package incord-desktop, lib
incord_desktop, binary incu), the way the sandbox became incord-sandbox. It
no longer depends on incode; incode depends on it.

The three couplings are cut inside the crate:
- permissions -> permission::Tier (observe / act / deny), reading incode's
  mode words so `-p read-only` keeps its meaning; `--tier observe|act` is the
  crate's own flag.
- hooks -> hooks::Hooks, a trait, with ShellHooks for incu. incode's
  `--desktop-mcp` hands the server its own HookRunner through an adapter, so
  the operator's commands run exactly as before.
- folders::create_dir_all -> std::fs::create_dir_all. incode creates the
  journal's folder, and wraps request_stop, so a fresh .incode/ still gets
  its .gitignore.
- config::Config reads limits, display and hooks, with serde aliases for
  desktop_limits / desktop_display / desktop_hooks, so incode's admin.json is
  a valid incu config as it stands.

incode keeps src/desktop.rs: a re-export so every crate::desktop::* path is
unchanged, the client registration that names incode's flags
(client_config*, codex_config_overrides), request_stop, and `serve`, the
wrapper `incode --desktop-mcp` calls. The 16 tools and their tiers are
unchanged; the "twelve tools" drift is fixed in permissions and the docs.

CI: the crate's clippy and tests run (cargo test --lib is incode's alone),
the Linux release-build job builds and ldd-checks incu, the X11 live test
points at the crate, and the release tag check covers the third crate.
wiring::MAX_UNWIRED falls 41 -> 38: that scan reads incode's src/ only.
@blockmandev
blockmandev merged commit 23fb30e into main Nov 13, 2026
12 checks passed
@blockmandev
blockmandev deleted the feat/incord-desktop-crate branch November 15, 2026 20:29
blockmandev added a commit that referenced this pull request Nov 15, 2026
…rs keeps only incode's part (#100)

src/desktop.rs re-exported the whole incord-desktop crate (pub use
incord_desktop::*) so the crate::desktop::... paths written before the
desktop moved to crates/desktop (#93) kept working. Its header called
rewriting them "a later step"; this is that step.

- Every use of the crate's own items now names it: incord_desktop::journal,
  ::capture, ::limits, ::safety::stop_path_in, ::thread, ::mcp::Server and
  ::mcp::tool_definitions (admin, migrate, team, tool_bridge, cli, serve,
  the toolbox, main.rs).
- src/desktop.rs no longer re-exports anything. It holds the three things
  that are incode's: the agent registration for `incode --desktop-mcp`
  (mcp::client_config, client_config_json, codex_config_overrides), the stop
  request behind incode's folder handling (safety::request_stop) and the
  `serve` wrapper. Those keep their crate::desktop paths.

No behaviour changes. cargo clippy --all-targets: clean. cargo test --lib:
2290 passed, 0 failed. cargo test --bins: 59 passed, 0 failed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant