layer
An ACP layer component: bidirectional middleware that wraps a downstream [`provider`] (or another [`layer`]) with the same protocol on both sides and in both directions. On the downstream (agent) side, a layer exports [`agent`] upstream and imports [`agent`] from the next stage — letting it intercept prompts, tool calls, and session control flowing toward the provider. On the upstream (client) side, a layer exports [`client`] (called by the next stage's [`client`] import) and imports [`client`] from the previous stage or host — letting it intercept `update-session` notifications, fs callbacks, terminal ops, and permission requests flowing back toward the editor. Useful for logging, prompt rewriting, tool-call filtering, denying permission requests, rewriting session updates, or routing across backends.