Transport Stdio

AEP Transport Binding: stdio

> Status: draft. Part of the AEP 0.1 protocol specification.

Purpose

Define how AEP runs over standard input / standard output, supporting local process integration with no network dependency.

Framing

AEP over stdio uses newline-delimited JSON (NDJSON):

Example stream:

{"aep_version":"0.1","id":"evt_01","type":"session.opened",...}
{"aep_version":"0.1","id":"evt_02","type":"session.ready",...}
{"aep_version":"0.1","id":"evt_03","type":"session.closed",...}

Direction

StreamDirectionPurpose
stdinTransport → ProcessInbound events (consumer receives)
stdoutProcess → TransportOutbound events (producer sends)
stderrProcess → TransportDiagnostic output and error events

stderr may carry:

Session Lifecycle

The process lifecycle maps directly to session lifecycle:

Process StateSession StateNotes
StartCREATED
First session.opened on stdinOPENED
session.ready sent on stdoutREADY
Process exit (0)CLOSEDGraceful shutdown
Process exit (non-0)ERRORUnexpected termination
stdin closedCLOSEDRemote peer disconnected
Broken pipe on stdoutCLOSEDRemote peer disconnected

Error Handling

Implementation Notes