Capabilities negotiation for adapters and participants.
Provides functions to check and filter inbound content blocks and outbound post payloads based on channel capabilities.
Summary
Functions
Returns all supported capability atoms.
Checks if a channel can deliver the given outbound postable payload.
Returns the delivery-focused capability list for an adapter module.
Returns the list of capabilities required for an inbound content block.
Filters a list of content or outbound payloads to only what the channel supports.
Checks if a capability is in the list of capabilities.
Returns a list of content or outbound payloads that the channel cannot deliver.
Types
@type capabilities() :: [capability()]
@type capability() ::
:text
| :image
| :audio
| :video
| :file
| :multi_file
| :markdown
| :cards
| :modals
| :ephemeral
| :tool_use
| :streaming
| :reactions
| :threads
| :typing
| :presence
| :read_receipts
| :assistant_events
Functions
@spec all() :: capabilities()
Returns all supported capability atoms.
@spec can_deliver?( capabilities(), Jido.Chat.Postable.t() | Jido.Chat.PostPayload.t() | map() ) :: boolean()
@spec can_deliver?( capabilities(), struct() ) :: boolean()
Checks if a channel can deliver the given outbound postable payload.
@spec channel_capabilities(module()) :: capabilities()
Returns the delivery-focused capability list for an adapter module.
@spec content_requires(struct()) :: capabilities()
Returns the list of capabilities required for an inbound content block.
@spec filter_content([term()], capabilities()) :: [term()]
Filters a list of content or outbound payloads to only what the channel supports.
@spec supports?(capabilities(), capability()) :: boolean()
Checks if a capability is in the list of capabilities.
@spec unsupported_content([term()], capabilities()) :: [term()]
Returns a list of content or outbound payloads that the channel cannot deliver.