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
| Op | Description |
|---|---|
fetch | Fetch messages since a watermark timestamp |
create_draft | Write a draft to the provider’s native Drafts folder |
draft_status | Poll whether a draft was sent, discarded, or still open |
health | Connectivity + credential check |
capabilities | Advertise 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§
- Capabilities
Params - Parameters for the
capabilitiesoperation. - Create
Draft Params - Parameters for the
create_draftoperation. - Draft
Envelope - The content of a draft message to be created.
- Draft
Status Params - Parameters for the
draft_statusoperation. - Fetch
Params - Parameters for the
fetchoperation. - Fetched
Message - A single fetched message.
- Health
Params - Parameters for the
healthoperation. - Messaging
Plugin Response - Response sent from a messaging plugin to TA over stdout.
Enums§
- Draft
State - Current state of a draft as reported by the provider.
- Messaging
Plugin Error - Errors from messaging plugin operations.
- Messaging
Plugin Request - Request sent from TA to a messaging plugin over stdin.
Constants§
- MESSAGING_
PROTOCOL_ VERSION - Protocol version implemented by this TA build.