MessageSender

Type Alias MessageSender 

Source
pub type MessageSender = Arc<dyn Fn(&str, &str) -> Result<bool, String> + Send + Sync>;
Expand description

Function type for controller-aware delivery of a message to a (non-PTY) agent.

Given (block_id, message), returns:

  • Ok(true) — delivered on the controller’s structured channel (persistent stream-json stdin / ACP session/prompt); no PTY keystrokes needed.
  • Ok(false) — the controller is PTY-based; the caller should fall back to keystroke injection.
  • Err(_) — a structured controller failed to accept the message (e.g. the persistent process is not running); the caller must NOT fall back to PTY, since such controllers reject raw keystrokes.

Aliased Type§

pub struct MessageSender { /* private fields */ }