pub enum PeerInboundKind {
Message {
id: String,
from: String,
org: String,
body: String,
},
DeliveryFailure {
target: String,
org: String,
reason: String,
},
WorkerSpawnFailed {
label: String,
reason: String,
},
Gotify {
app: String,
title: String,
message: String,
priority: u8,
},
Cron {
prompt: String,
},
Voice {
note: String,
},
Slack {
workspace: String,
channel: String,
author: Option<String>,
body: String,
},
}Expand description
One inbound peer block parsed from the user-turn text.
Wire envelopes carry fields (the send’s id, the originating org) that the previous chrome surfaced as DIM meta chunks. The redesigned chat block hides those by default - the parser still retains them, and the id is what the chat-streak grouping keys a messaging group on.
Variants§
Message
[Message id=m-... from agent 'X' (org 'Y')]\n\n<body>
Every peer message is this one kind: a reply is just another message, so there is nothing left for a second kind to say.
DeliveryFailure
[Message to agent 'X' (org 'Y') failed to deliver: <reason>]
Sender-side delivery failure: a message parked for a sleeping
project whose spawn then failed.
The older [Ask id=... to agent 'X' ... failed to deliver: ...]
shape parses to this same kind, so a replayed transcript still
draws its failure.
WorkerSpawnFailed
[Worker '<label>' spawn failed id=<id>: <reason>]
Lead-side notice that a team worker’s async spawn failed
(subprocess crashed inside the --worktree machinery before
reaching Connected). Reason text is verbatim from claude’s
stderr. Kept as a one-line system notice rather than a peer
row because it’s a workspace-generated lifecycle event, not a
peer comm - touching its render shape is out of scope for
#189.
Gotify
[Gotify - app 'X', priority N]\n<title>\n<message> - an inbound
external Gotify notification delivered as a user turn. Rendered
with distinct chrome (the ◈ gotify glyph, Gotify source label) so it
reads as an external event, not agent traffic. Never groups with
peer envelopes (see PeerInboundKind::peer_sender_identity).
Cron
[Cron]\n\n<prompt> - a durable cron that fired into this session,
delivered as a user turn. Rendered with the ◴ cron glyph + a Cron
source label so it reads as a scheduled internal event, not agent
traffic. Never groups with peer envelopes (see
PeerInboundKind::peer_sender_identity).
Voice
[Voice]\n\n<note> - forge telling the seat’s session the reader is
listening or has stopped, delivered as a user turn. The note is for
the agent, so it draws as an information row rather than as the
reader’s own turn. Never groups with peer envelopes (see
PeerInboundKind::peer_sender_identity).
Slack
[Slack - workspace 'X', <channel>] id ... ts ... then one
<author>: <text> [ts ...] line per delivered message - a
conversation’s news, delivered as a user turn. Rendered with the
◇ glyph + a Slack source label so it reads as an external event,
not agent traffic. Never groups with peer envelopes (see
PeerInboundKind::peer_sender_identity).
Fields
None when there is no name to print. The producer resolves the
author before the prose is written, so a bot’s message carries the
user id it always had and its own profile name beside it; a name
that resolved to nothing leaves unknown in the clause, which is
dropped here. Also None for a multi-message body, whose members
each name their own author.
Implementations§
Source§impl PeerInboundKind
impl PeerInboundKind
Sourcepub fn org(&self) -> &str
pub fn org(&self) -> &str
The sender_org field threaded through every variant - drives
same-project envelope grouping in a view’s chat iteration.
Variants that carry an explicit org return it; the
worker-spawn-failure notice has no org of its own (it’s
lead-local, with no sending project) so it returns an empty
string and naturally groups with adjacent lead-local envelopes.
Sourcepub fn peer_sender_identity(&self) -> Option<&str>
pub fn peer_sender_identity(&self) -> Option<&str>
The peer/worker sender identity used for envelope grouping (the
from / target / label name). None for Gotify, Cron and
Slack: those are not agent traffic and must never merge into a peer
messaging group - the grouping predicates key off Some(..) here.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PeerInboundKind
impl RefUnwindSafe for PeerInboundKind
impl Send for PeerInboundKind
impl Sync for PeerInboundKind
impl Unpin for PeerInboundKind
impl UnsafeUnpin for PeerInboundKind
impl UnwindSafe for PeerInboundKind
Blanket Implementations§
§impl<T> AnySync for T
impl<T> AnySync for T
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<S, T> Duplex<S> for Twhere
T: FromSample<S> + ToSample<S>,
§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more