acp-runtime
AgentThe 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 and their platform implementations can remain close without collapsing their dependency boundaries.
This page defines the target organization of `packages/core/src/`. Core is organized by module type so that shared domain APIs and their platform implementations can remain close without collapsing their dependency boundaries.
This is the active architecture. Runtime and service implementations live in `packages/core`; application hosts own worker entries and build manifests.
The desktop app and workspace-server deploy many of the same capabilities in different hosts. Keeping their contracts in one package and their implementations in another makes a single domain span distant trees, duplicates export and build configuration, and makes coordinated changes harder to review.
Core therefore owns both:
Separate subpath exports preserve the important platform boundary. Colocation does not mean that browser code may import Node implementations.
Every top-level Core module belongs to one of three types:
packages/core/src/ runtimes/ services/ primitives/
A runtime is a host-scoped composition root for a larger product domain.
A runtime typically:
Examples include ACP, Git, Files, agent configuration, TUI agents, and workspaces.
Runtimes are peers. **A runtime must never depend on another runtime**, including another runtime's API surface. Shared vocabulary belongs in a primitive. Shared active behavior belongs in a service. Cross-runtime workflows are composed by the application host, not by either runtime.
Node runtime implementations that expose a Wire contract should also provide a `WireComponent` definition from their `node/` surface. The component is the deployment wrapper: it declares typed requirements, validates config at the creation/worker boundary, and creates the existing runtime and controller. It must not auto-locate other services or recursively construct dependencies.
A service is a focused, injectable capability that can be reused by runtimes.
A service may:
A service must not depend on a runtime or another service. Shared contracts, vocabulary, and portable ports that need to cross service boundaries belong in primitives. Concrete service implementations are composed by a runtime or host.
Examples include filesystem watching, PTY management, host dependency detection, and other cross-domain host capabilities.
Services that need to run in process or out of process use the same `WireComponent` convention as runtimes. The distinction between runtime and service remains architectural ownership, not a different hosting primitive.
A primitive is reusable vocabulary or behavior that does not orchestrate a product domain.
A primitive should:
Examples include host-aware paths, resource identifiers, concurrency helpers, and pure validation or normalization utilities.
Primitives may depend on other primitives, but those dependencies must remain acyclic.
`@emdash/shared` owns package-level foundations that are below Core, Wire, desktop, workspace-server, and tests. Do not move these into Core primitives just because Core uses them:
`ResourceCache`, `SharedResource`, `AsyncCache`, bounded buffers, and disposable helpers.
and `retry()`.
helpers.
Core primitives should hold Emdash domain vocabulary, portable contracts, and narrowly scoped domain behavior. Shared foundations should hold reusable lifecycle, concurrency, scheduling, testing, result, logging, and utility behavior that has no Core domain ownership.
Choose lifecycle primitives by ownership shape:
`register()`, queryable state, typed start/stop results, and state-change observers.
(`packages/core/src/runtimes/acp/node/machine/primitive/`), not a shared building block; it promotes back to `primitives/` only when a second runtime adopts it.
optionally with an idle TTL. Use `SharedResource` for one unkeyed leased resource and `AsyncCache` for cached async values without finalizers.
process-hosted Wire component with a stable client, readiness, restart backoff, and process generations. The lower-level worker slot is internal to `@emdash/wire`.
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…
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.