LemonChannels.Adapters.Telegram.Transport.InboundActions (lemon_channels v0.1.0)

View Source

Telegram-local execution helpers for normal inbound message submission.

This module owns the side effects that happen after command/session routing decides a message should be submitted onward. It stays local to the Telegram transport and avoids introducing a shared cross-channel action framework.

Summary

Types

callbacks()

@type callbacks() :: %{
  extract_explicit_resume_and_strip: (binary() ->
                                        {LemonCore.ResumeToken.t() | nil,
                                         binary()}),
  extract_message_ids: (map() ->
                          {integer() | nil, integer() | nil, integer() | nil}),
  current_thread_generation: (map(), integer() | nil, integer() | nil ->
                                integer() | nil),
  maybe_index_telegram_msg_session: (map(),
                                     LemonCore.ChatScope.t()
                                     | nil,
                                     binary()
                                     | nil,
                                     [integer() | nil] ->
                                       any()),
  maybe_subscribe_to_session: (binary() -> any()),
  resolve_model_hint: (map(),
                       binary()
                       | nil,
                       integer()
                       | nil,
                       integer()
                       | nil ->
                         {binary() | nil, atom() | nil}),
  resolve_session_key: (map(), map(), LemonCore.ChatScope.t() | nil, map() ->
                          {binary() | nil, boolean()}),
  resolve_thinking_hint: (map(), integer() | nil, integer() | nil ->
                            {binary() | nil, atom() | nil}),
  update_chat_state_last_engine: (binary(), binary() -> any())
}

Functions

execute_inbound_message(state, inbound, callbacks)

@spec execute_inbound_message(map(), map(), callbacks()) :: map()

submit_buffer(state, buffer, callbacks)

@spec submit_buffer(map(), map(), callbacks()) :: map()