Skip to main content

MessageSender

Type Alias MessageSender 

Source
pub type MessageSender = Arc<dyn Fn(&str, &str) -> Result<SenderDelivery, 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(SenderDelivery::Delivered) — delivered on the controller’s structured channel (persistent stream-json stdin / ACP session/prompt); no PTY keystrokes needed.
  • Ok(SenderDelivery::Deferred) — accepted on that channel but queued because the agent’s process is starting up, restarting or stopping; written once it can take it (SPEC_JEKT_IMMEDIATE_DELIVERY_2026_09_28.md §2.1). The message is safe; the agent just hasn’t seen it yet.
  • Ok(SenderDelivery::Pty) — 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 */ }