Skip to content

EventMapping

Category: Acp

Source: event_mapping.dart

Translates Glue's typed [SessionEvent] vocabulary (from glue_core) into ACP session/update payloads.

Pure function — no harness state, no side effects. The server class in server.dart calls this to render every event the harness emits.

Coverage today: the conversation, tool, and thinking events that ACP has direct counterparts for. Lifecycle events (TurnStarted/Completed, StatusChange, MetricsUpdated, TitleGenerated) and permission/auth events return null — they are handled out-of-band by the server (e.g. permission events drive session/request_permission requests, not session/update notifications).

Functions

SessionUpdate? sessionEventToAcpUpdate(SessionEvent event)

Maps a single [SessionEvent] to a [SessionUpdate], or returns null when the event has no session/update representation.

Released under the MIT License.