module Rooibos::Message::System
System command response types.
Contains message types for system command results.
Constants
- Batch
-
Response from a system command (batch mode).
Shell commands capture output and status. Without structured responses, handling success vs error requires manual parsing of arrays.
This response includes predicates for common checks and deconstructs for pattern matching. Include
Predicatesfor safe predicate calls.Use it to handle
Command.systemcompletions (batch mode).Example
case msg in { type: :system, envelope: :build, status: 0, stdout: } model.with(output: stdout) in { type: :system, envelope: :build, status: } model.with(error: "Build failed with exit #{status}") end
- Stream
-
Streaming message from a system command.
Streaming commands send incremental output instead of batching. Each line is a separate message, followed by a completion message.
This message includes predicates to distinguish stdout, stderr, and completion events for pattern matching workflows.
Use it to handle
Command.system(..., stream: true)output.Example
case msg in { type: :system_stream, envelope: :build, stream: :stdout, content: } model.with(log: model[:log] + content) in { type: :system_stream, envelope: :build, stream: :complete, status: 0 } model.with(success: true) end