Repository navigation
Architecture
How the codebase is laid out and the two invariants every change must respect. The mechanisms that make a feature a deletable plug-in are on Runtime seams.
Code is clean if it can be read, and enhanced by a developer other than its original author. Every line must justify its existence through clear naming and thorough documentation of why it exists.
-
Angular 22, standalone + zoneless. Signals are the reactive model; there is no Zone.js. A
@Service()decorator (=@Injectable({ providedIn: 'root' })) marks DI singletons. -
Electron, main + preload written in TypeScript and esbuild-bundled (not
tsc-emitted);tsc --noEmittype-checks them. -
Vitest for tests; ESLint (typed rules) + Prettier (
printWidth: 100) enforce the house style mechanically. - Node is pinned via
.nvmrc(currently24.16.0) — runnvm usebefore working.
src/ contains exactly two subdirectories:
src/features/<feature>/{angular,electron,api} ← recipes: compose shared parts
src/shared/{angular,api,app,electron} ← kitchen: runtime + reusable parts
The eight features are workspace (the directory tab), repository (source-control), code,
markdown, terminal, agent, settings, and welcome. settings and welcome are leaf
consumers of shared infra modelled as features for uniformity.
-
No feature code lands in
shared.shared/{angular,api,electron}must not name or import any feature. (shared/app— the assembler — is the sole exception; see below.) -
Features are isolated like plugins. Everything a feature needs lives under
src/features/<feature>/; a feature imports only@shared/*and@features/*, never a sibling feature's internals by relative path. Removing a feature's folder removes the feature — the only permitted straggler is one line insrc/shared/app/config.ts.
Enforced, not just documented. INV2 is mechanically checked by ESLint.
eslint.config.jsgenerates a per-feature@typescript-eslint/no-restricted-importsrule that bans importing a sibling@features/<other>/*— a feature may import only@shared/*and its own@features/<self>/*. A cross-feature import failsnpm run lint. The fix is always to promote the shared surface to@shared, never to add a cross-import (precedent:MarkdownCommands→@shared/angular/services/markdown-commands,CommitDetail→@shared/angular/components/panels/commit-detail).
shared is a kitchen stocked with reusable capability components, framework, atoms, cross-cutting
services, and the generic IPC transport. Features are recipes: a leaf view composes shared parts plus
its own ribbon / commands / status glue and its own api/electron surface.
src/shared/app is a deliberately tiny sibling of angular/api/electron. It is the only code
allowed to name features, because it is the composition root:
-
config.ts— the feature enumeration (sevenprovide<F>Feature()calls;welcomeis mounted directly byroot). This is the one place that lists features; delete a feature = delete its folder- remove its line here.
-
root/— theapp-rootcomponent that mounts the shell chrome + the active tab's view. -
main.ts— the Angular bootstrap.global.d.ts— the ambientWindow.bridge/hosttypes.index.html— the HTML entry.
The kitchen's capability components are thin wrappers around exactly one engine each — no splitter, no side panels, no ribbon, no embedded agent:
| Wrapper | Wraps | Backing plumbing (also in shared) |
|---|---|---|
<app-terminal> |
xterm (node-pty backend) | pty api contract + electron terminal-manager + terminal-bridge |
<app-text-editor> |
Monaco | monaco service + Editors (model-URI → document registry) |
<app-markdown-editor> |
Milkdown / ProseMirror | milkdown service + plugins |
<app-agent> |
the agent chat UI | agent-runtime / ai-auth / agent-sessions + the ai bridge |
Because a shared wrapper depends on its plumbing, the plumbing is shared too — so the terminal
feature owns little-to-no unique electron/api; it composes the shared capability.
Feature views are leaves that compose the shared panel layout with these wrappers:
terminal-view = layout{ main: <app-terminal>, side: <app-agent> }
code-view = layout{ main: <app-text-editor>, sides: <app-terminal>, <app-agent> }
markdown-view = layout{ main: <app-markdown-editor>, sides: outline/review/reader, <app-agent> }
Do not sub-divide a capability wrapper or "improve" it while touching it. It is the kitchen.
Using Studio
Contributing
How it works
- Architecture
- Runtime seams
- Agent access and permissions
- Agent MCP capabilities
- Agent surfaces, prompts and skills
- Source control
- Plugins
- Package managers
- Language servers — capability matrix
- Language servers — adding a server
- Setup wizard
- Container engines
Decisions