ExMCP.ACP.Adapters.ZCode.Mapper (ex_mcp v1.3.0)

Copy Markdown View Source

Pure ZCode event to ACP message mapping.

Translates ZCode session/event typed notifications, server-initiated requests, and response messages into ACP session/update notifications and JSON-RPC responses.

Summary

Functions

Reduces a decoded ZCode message (response, server request, or notification) into ACP messages, port writes, and new adapter state.

Replays snapshot messages as ACP session/update chunks.

Builds the ACP session setup result from a ZCode snapshot.

Functions

reduce_message(msg, state)

@spec reduce_message(map(), map()) :: {[map()], [iodata()], map()}

Reduces a decoded ZCode message (response, server request, or notification) into ACP messages, port writes, and new adapter state.

replay_snapshot_history(session_id, snapshot)

@spec replay_snapshot_history(String.t(), map()) :: [map()]

Replays snapshot messages as ACP session/update chunks.

session_result(session_id, snapshot, state)

@spec session_result(String.t(), map(), map()) :: map()

Builds the ACP session setup result from a ZCode snapshot.