LemonRouter.SurfaceManager (lemon_router v0.1.0)

View Source

Router-owned semantic output façade for RunProcess.

RunProcess uses this module as its output API. Answer streaming still lives in StreamCoalescer, tool/task status streaming still lives in ToolStatusCoalescer, and channel-specific presentation remains in lemon_channels. SurfaceManager owns the router-side coordination across those surfaces, including answer/status handoff, task-surface bookkeeping, and final-answer fanout.

Summary

Functions

commit_status_segment(state, surface \\ :status)

@spec commit_status_segment(map(), term()) :: :ok

fanout_final_answer(state, event)

@spec fanout_final_answer(map(), LemonCore.Event.t()) :: :ok

finalize_answer(state, event, extra_meta)

@spec finalize_answer(map(), LemonCore.Event.t(), map()) :: :ok

finalize_status(state, event)

@spec finalize_status(map(), LemonCore.Event.t()) :: :ok

flush_all(state)

@spec flush_all(map()) :: :ok

flush_status(state)

@spec flush_status(map()) :: :ok

handoff_answer_to_status(state, surface)

@spec handoff_answer_to_status(map(), term()) :: :ok

ingest_answer_delta(state, delta)

@spec ingest_answer_delta(map(), map()) :: :ok

ingest_projected_child_action(state, action_event, surface)

@spec ingest_projected_child_action(map(), map(), term()) :: :ok

ingest_status_action(state, action_event, surface)

@spec ingest_status_action(map(), map(), term()) :: :ok

maybe_seed_final_answer(state, event)

@spec maybe_seed_final_answer(map(), LemonCore.Event.t()) :: :ok

prepare_status_action(state, action_event)

@spec prepare_status_action(map(), map()) :: {map(), term(), boolean()}