acp-runtime
The ACP runtime is the domain service that serves the ACP API contract. It owns the host-scoped dependencies needed to run provider ACP sessions, but it should…
Each domain exposes a Wire contract in `src/core/features/<domain>/api/` and a controller in `src/core/features/<domain>/node/`:
How it fires
How this agent gets triggered: by you, by Claude, or both.
Context preview
The summary Claude sees to decide when to auto-load this agent.
Each domain exposes a Wire contract in `src/core/features/<domain>/api/` and a controller in `src/core/features/<domain>/node/`:
Each domain exposes a Wire contract in `src/core/features/<domain>/api/` and a controller in `src/core/features/<domain>/node/`:
// src/core/features/tasks/node/wire-controller.ts
export function createTasksWireController(): Controller {
return createController(tasksWireContract, {
createTask: (input) => taskOperations.createTask(input),
events: taskEvents,
});
}Contracts are assembled in `src/core/manifests/shared/desktop-wire-contract.ts`; controllers are served by `src/main/gateway/desktop-wire.ts`.
**Rules:**
Construct stateful services explicitly at the bootstrap composition root:
export type AppServiceDeps = {
db: AppDb;
};
export class AppService {
constructor(private readonly deps: AppServiceDeps) {}
private cache = new Map();
async initialize() { /* ... */ }
async doSomething(id: string) { /* ... */ }
}
export function createAppService(deps: AppServiceDeps): AppService {
return new AppService(deps);
}**Rules:**
service scope or shutdown coordinator.
Portable schema and database types live in `src/core/services/app-db/node/`. Main constructs the native Drizzle client during the database boot phase.
time; never call `getAppDb()` at module scope.
For domain logic with multiple backends (local vs SSH):
src/main/core/projects/ ├── project-provider.ts # Interface ├── impl/ │ ├── local-project-provider.ts │ └── _ssh-project-provider.ts # Prefixed with _ = not yet implemented └── project-manager.ts # Orchestrates providers
Used in: projects, filesystem (`local-fs.ts` / `ssh-fs.ts`), terminals (`local-terminal-provider.ts` / `ssh-terminal-provider.ts`)
Explicit error handling via discriminated union:
import { ok, err, type Result } from '../lib/result';
async function doSomething(): Promise<Result<Data, SomeError>> {
if (problem) return err({ type: 'not_found' as const });
return ok(data);
}**Rules:**
Use Wire event-stream hosts for main-to-renderer notifications:
export const taskEvents = createEventStreamHost(tasksWireContract.events);
taskEvents.emit(undefined, { type: 'created', task });Event definitions belong to the owning slice's portable API. Use live models for replicated state and live jobs for cancellable long-running work.
Emdash is the Open-Source Agentic Development Environment (🧡 YC W26). Run multiple coding agents in parallel. Use any provider.
Repo: generalaction/emdash
The ACP runtime is the domain service that serves the ACP API contract. It owns the host-scoped dependencies needed to run provider ACP sessions, but it should…
This page defines the target organization of `packages/core/src/`. Core is organized by module type so that shared domain APIs and their platform…
Git is split into a transport contract and a host-scoped runtime. Renderer, desktop, and workspace-server code share the Wire vocabulary without importing Git…
The main process is organized into domain modules under `src/main/core/`. Each domain typically has a `controller.ts` (RPC handlers) and service/implementation…
`@emdash/core/primitives/path/api` is the source of truth for portable file identity and lexical path operations. The detailed package docs live in…