Skip to main content

Module sink

Module sink 

Source
Expand description

SinkMiddleware — the SpawnerLayer for the Data plane (Big Response handling).

§Role

A SpawnerLayer that bridges crate::store::output (the Data owner) and the Agent execution boundary. Just before spawn it injects a Data-plane endpoint hint into Ctx.meta.runtime, giving SubAgents a place to POST Big Response bodies (4k-token payloads, files, intermediate artifacts) directly into the store, bypassing MainAgent.

It does not touch the Domain path (the engine’s submit_output / output_tail / dispatch verdict). The flow stays as-is; this layer is strictly additive and runs alongside (the Data / Domain separation axis). For the canonical narrative see the crate::store::output module doc.

§Pattern

Same shape as AgentResolver and ProjectNameAliasMiddleware: edit ctx, call the inner spawner, done. Engine state is not touched.

§Implementation status

  • Current (scaffold): SpawnerLayer trait impl plus the endpoint hint injection into Ctx.meta.runtime. The Arc<dyn OutputStore> reference is held in config, but the real intake path (the POST /v1/data/emit HTTP handler routed to OutputStore::append) is still a carry.
  • Carry: add the Big Data endpoint on the mlua-swarm-server side, wire the SubAgent-side EMIT tool call driven by the agent.md contract, and thread it through end-to-end.

Structs§

SinkMiddleware
Data-plane SpawnerLayer. Config: the store to reference plus the endpoint hint.

Constants§

DATA_SINK_ENDPOINT_KEY
Key under ctx.meta.runtime that carries the Data-plane endpoint hint.