acp-runtime
AgentThe ACP runtime is the domain service that serves the ACP API contract. It owns the host-scoped dependencies needed to run…
All paths are relative to `apps/emdash-desktop/`.
All paths are relative to `apps/emdash-desktop/`.
A feature slice's `api/` directory is its contract with other slices, nothing more:
aggregated by `src/core/manifests/browser/browser-contributions.ts`), never through `api/`
(enforced by the `emdash/no-tsx-in-api` lint rule; the shrink-only allowlist at repo-root `tooling/oxlint/allowlists/api-surfaces.json` is empty and must stay that way)
Modals are renderer-only feature contributions. They render as a stack, with only the top modal responding to outside presses and close commands.
store (`modal-store.ts` — active modal state and promise outcomes), and the close-guard hook (`use-close-guard.ts`)
`useModalController`
**Adding a modal:** 1. Create the component in its feature slice. Caller data is ordinary component props; completion uses `useModalController(id)`. 2. Define it with `defineModal<TResult>()({ id, component, ...chrome })`. 3. Add the definition to the owning slice's `modalDefs`. 4. Open it through the typed API and branch on the outcome:
const openMyModal = useOpenModal('myModal');
const outcome = await openMyModal({ projectId: '123' });
if (outcome.success) {
useResult(outcome.data);
}**Rules:**
passive or navigation dismissal
Views use a contributions + catalog + parameterized navigation pattern.
`layout`, and optional `historyKey`) and the React runtime bindings (`registerViewRuntime`, which binds slots such as `MainPanel`, `WrapView`, and `TitlebarSlot`)
`NavigationHistoryStore` (app-scoped), `getNavigation()` selectors, and React hooks (`useNavigate`, `useViewParams`, `useCurrentViewParams`); the renderer bootstrap seeds the catalog through `seedRendererNavigationHost()` before the app scope creates the stores
the per-project workspace chrome command store and exposes the layout-storage facade
**Key behaviors:**
(`taskViewDef({ projectId, taskId })`); the schema validates params at construction, and `safeRef()` is the boundary for untrusted values
optional can be called without an argument
`useCurrentViewParams(def)` also returns `setParams` for updating the active view's params
**Rules:**
entity (for example per task)
`src/core/manifests/browser/view-catalog.ts`
Workbench layout follows a strict ownership model (see `.scratch/workbench-state-architecture/spec.md` history for rationale):
(`sidebarCollapsed`, `sidebarTab`, `terminalDrawerOpen`) and workspace chrome (`leftSidebarOpen`, `zen`) are memento-backed state objects mutated only through named commands (`toggleSidebar`, `openSidebarTab`, `enterZenMode`, ...) — never through field setters. The shared mechanism is `defineChromeStore` in `src/core/primitives/chrome-stores/`.
writes.** Closed = unmounted. Collapsible surfaces bind through `useCollapsiblePanelBinding` from `@emdash/ui` (next to `Resizable`), which turns drag-below-threshold into a semantic close command. No `panel.collapse()` / `expand()` / `resize()` / `setLayout()` calls exist in app code, and no `display:none` toggling of workbench surfaces.
`LayoutStorage` facade (`createLayoutStorage` in `src/core/primitives/mementos/browser/`). Sizes are never MobX observables and never persisted to localStorage. Collapsible surfaces (sidebars, terminal drawer) persist the pixel size the user resized them to through `useCollapsiblePanelBinding`: window resizes go to the other panels and are never persisted, and a clamp in a small window lifts once the window grows again. Proportional splits (split panes, changes
Emdash is the Open-Source Agentic Development Environment (🧡 YC W26). Run multiple coding agents in parallel. Use any provider.
The ACP runtime is the domain service that serves the ACP API contract. It owns the host-scoped dependencies needed to run…
This page defines the target organization of `packages/core/src/`. Core is organized by module type so that shared domain APIs…
Git is split into a transport contract and a host-scoped runtime. Renderer, desktop, and workspace-server code share the Wire…
The main process is organized into domain modules under `src/main/core/`. Each domain typically has a `controller.ts` (RPC…
`@emdash/core/primitives/path/api` is the source of truth for portable file identity and lexical path operations. The detailed…
Validates project structure against co-location and architecture patterns defined in AGENTS.md
Deprecated placeholder. Do not use; follow root AGENTS.md and package instructions instead.
Use this agent when you need to create or update technical documentation that helps developers understand the deep patterns,…
Orchestration patterns learned from experience. Review at startup and before heartbeat responses.