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
| Crate | Responsibility |
|---|---|
krad-domain | Ids, 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-pty | Process spawning and PTY I/O over portable-pty: Unix PTY, Windows ConPTY and WSL, behind a platform-neutral API |
krad-term | Terminal emulation over libghostty-vt: bytes in, renderable snapshots out, key and mouse input encoded |
krad-session | One PTY plus one terminal, with their threads and events |
krad-store | The 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-repo | A group's folder: listing, the file index behind @ mentions, git status and worktrees through the git CLI, and the notes vault |
krad-chat | Each harness's live chat, and the Gateway agent with its tools and MCP client |
krad-host | This computer or an SSH host: files over SFTP, commands, terminals and port forwards |
krad-lsp | Language server client over stdio, here or on the environment's host |
krad-extensions | Language, toolchain and server runtime manifests and the package registry: locating, installing and launching servers, and finding toolchains |
krad-update | Signed release manifests, verified downloads and in-place installs |
krad-agents | The agents bus, its line-JSON protocol, the mailbox and the krad-ade-agents CLI |
krad-gitlab | GitLab REST API v4 and OAuth |
krad-github | GitHub REST and GraphQL APIs and device sign-in |
krad-ui | Every view, element, action, keymap and theme |
krad-app | The krad-ade and krad-ade-agents binaries |
Dependency rules
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-domaindepends on no workspace crate and on none ofgpui,libghostty-vtortokio.krad-termdoes not depend onkrad-pty; it is tested by feeding raw bytes.gpuiis only allowed inkrad-uiandkrad-app.krad-sessionre-exports the PTY and terminal items the UI needs, sokrad-uinever depends onkrad-ptyorkrad-termdirectly.
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-adeis the desktop app: bootstrap, wiring and window creation, kept thin.krad-ade-agentsis its own console program, since the Windows desktop build runs without a console. It only callskrad-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:
just format-check # rustfmt with the pinned nightly
just lint # clippy, pedantic, no unwrap / expect / panic
cargo test --workspaceThe engineering guide every change follows is the repository's CLAUDE.md, and the vocabulary the code uses is in CONTEXT.md.