Skip to main content

Module messaging_plugin_protocol

Module messaging_plugin_protocol 

Source
Expand description

JSON-over-stdio protocol types for external messaging adapter plugins.

Messaging adapter plugins communicate with TA using a request/response protocol over stdin/stdout. TA spawns the plugin process, writes one JSON request line to stdin, reads one JSON response line from stdout.

§Protocol overview

Every exchange is a single JSON line in each direction:

TA → plugin: {"op":"<name>",...params...}
plugin → TA: {"ok":true,...result...}   or   {"ok":false,"error":"..."}

§Operations

OpDescription
fetchFetch messages since a watermark timestamp
create_draftWrite a draft to the provider’s native Drafts folder
draft_statusPoll whether a draft was sent, discarded, or still open
healthConnectivity + credential check
capabilitiesAdvertise which optional ops this plugin supports

§Safety invariant — send is absent by design

The send operation is intentionally absent from this protocol. TA never sends messages on behalf of the user. Plugins expose only create_draft; the user sends from their native email client. This is a deliberate safety boundary enforced at the type level.

Structs§

CapabilitiesParams
Parameters for the capabilities operation.
CreateDraftParams
Parameters for the create_draft operation.
DraftEnvelope
The content of a draft message to be created.
DraftStatusParams
Parameters for the draft_status operation.
FetchParams
Parameters for the fetch operation.
FetchedMessage
A single fetched message.
HealthParams
Parameters for the health operation.
MessagingPluginResponse
Response sent from a messaging plugin to TA over stdout.

Enums§

DraftState
Current state of a draft as reported by the provider.
MessagingPluginError
Errors from messaging plugin operations.
MessagingPluginRequest
Request sent from TA to a messaging plugin over stdin.

Constants§

MESSAGING_PROTOCOL_VERSION
Protocol version implemented by this TA build.