Skip to main content

Module ipc

Module ipc 

Source
Expand description

NDJSON IPC protocol for PM ↔ sub-agent communication.

Why: Provides a framing-safe wire protocol over stdin/stdout pipes so the PM and sub-agent subprocesses exchange structured messages without ambiguity. What: IpcMessage enum (Task/Result/Error), HistoryMessage wire type, serialize_message/parse_message helpers. Test: ipc::tests::* round-trips every variant. NDJSON IPC protocol for PM <-> sub-agent communication.

Why: Provides a minimal, newline-delimited JSON protocol so the PM and sub-agent subprocesses can exchange structured messages over stdin/stdout without framing ambiguity. What: Defines the IpcMessage enum (Task / Result / Error), the HistoryMessage wire type for conversation history, and helpers to serialize to/from single-line JSON. Test: Round-trip each variant through serialize_message + parse_message and assert equality (see unit tests below).

Structs§

HistoryMessage
Simple {role, content} serializable form used over IPC.

Enums§

IpcMessage
A single IPC message exchanged between the PM and a sub-agent.

Functions§

extract_files_from_content
Parse ## File: <path> / ### \`sections from LLM output into a list of(relative_path, body)` pairs, without touching the filesystem.
extract_summary
Extract a summary from an agent’s content output.
parse_message
Parse a single NDJSON line into an IpcMessage.
serialize_message
Serialize an IpcMessage to a single NDJSON line (trailing \n).