Skip to Content
Krad ADE
Architecture

Crates

The workspace's crates, what each one owns and the dependency rules between them.

The workspace is split by responsibility, and the dependency rules are strict: the domain has no UI, terminal or I/O types, and GPUI only reaches krad-ui and krad-app. The root Cargo.toml is a virtual workspace with no package of its own.

Responsibilities

CrateResponsibility
krad-domainIds, environments, hosts, groups, sessions and their panes, agents and harnesses, notes, settings, the review types every code host reads into, and the persisted layout format. No GPUI or terminal types and no I/O.
krad-ptyProcess spawning and PTY I/O over portable-pty: Unix PTY, Windows ConPTY and WSL, behind a platform-neutral API
krad-termTerminal emulation over libghostty-vt: bytes in, renderable snapshots out, key and mouse input encoded
krad-sessionOne PTY plus one terminal, with their threads and events
krad-storeThe app's files on disk: the config folder, the layout file and its writer thread, settings.json, logins, the Gateway key and MCP secrets in the system keyring, pasted chat images and Gateway chat sessions
krad-repoA group's folder: listing, the file index behind @ mentions, git status and worktrees through the git CLI, and the notes vault
krad-chatEach harness's live chat, and the Gateway agent with its tools and MCP client
krad-hostThis computer or an SSH host: files over SFTP, commands, terminals and port forwards
krad-lspLanguage server client over stdio, here or on the environment's host
krad-extensionsLanguage, toolchain and server runtime manifests and the package registry: locating, installing and launching servers, and finding toolchains
krad-updateSigned release manifests, verified downloads and in-place installs
krad-agentsThe agents bus, its line-JSON protocol, the mailbox and the krad-ade-agents CLI
krad-gitlabGitLab REST API v4 and OAuth
krad-githubGitHub REST and GraphQL APIs and device sign-in
krad-uiEvery view, element, action, keymap and theme
krad-appThe krad-ade and krad-ade-agents binaries

Dependency rules

Allowed edges
krad-app
├── krad-ui
│   ├── krad-session
│   │   ├── krad-pty
│   │   └── krad-term
│   ├── krad-repo, krad-chat, krad-lsp, krad-extensions, krad-agents
│   │   └── krad-host (allowed for each of these)
│   ├── krad-store
│   ├── krad-gitlab, krad-github
│   ├── krad-update
│   └── krad-host
├── krad-agents
└── krad-store

krad-host → krad-domain only
any crate → krad-domain
  • No other edges and no cycles.
  • krad-domain depends on no workspace crate and on none of gpui, libghostty-vt or tokio.
  • krad-term does not depend on krad-pty; it is tested by feeding raw bytes.
  • gpui is only allowed in krad-ui and krad-app.
  • krad-session re-exports the PTY and terminal items the UI needs, so krad-ui never depends on krad-pty or krad-term directly.

Shared types

A type that two crates share lives once, in the lower of the two, and the higher one re-exports it. Review shows this well: GitLab and GitHub data both end up in review types defined in krad-domain, which is why Review is a single view for either code host.

The two binaries

  • krad-ade is the desktop app: bootstrap, wiring and window creation, kept thin.
  • krad-ade-agents is its own console program, since the Windows desktop build runs without a console. It only calls krad-agents, and also builds as a static musl binary for Linux x86_64 and aarch64, which the app uploads to remote hosts.

Contributing

Before opening an issue or pull request, the repository asks for:

Terminal
just format-check        # rustfmt with the pinned nightly
just lint                # clippy, pedantic, no unwrap / expect / panic
cargo test --workspace

The engineering guide every change follows is the repository's CLAUDE.md, and the vocabulary the code uses is in CONTEXT.md.

On this page