Struct IngressContext
pub struct IngressContext {
pub message_id: Option<String>,
pub source_class: SourceClass,
pub sender: Option<String>,
pub transport: Transport,
pub trust: TrustClass,
pub origin: TurnOrigin,
pub internal_principal: Option<InternalPrincipal>,
}Expand description
The envelope stamped by the entry layer; travels with the turn into the engine. See the module docs.
Fields§
§message_id: Option<String>Stable inbound id (e.g. a ChannelMessage.id) — provenance + audit
handle. None for id-less internal turns.
source_class: SourceClassWhether the turn is external or internally driven.
sender: Option<String>Platform user id / principal of the sender, if any.
transport: TransportThe transport the turn arrived on.
trust: TrustClassThe resolved trust class of the sender.
origin: TurnOriginWho initiated the turn (see TurnOrigin). Serde-defaults to
TurnOrigin::SubTurn so envelopes serialized before this field
existed deserialize fail-closed (no origin-gated behavior).
internal_principal: Option<InternalPrincipal>The internal principal that initiated the turn, when the dispatching
surface stamps one (see InternalPrincipal). None for external
turns, for internal paths that have no principal contract yet, and
for envelopes serialized before this field existed (serde-defaults
fail-closed to absent).
Implementations§
Source§impl IngressContext
impl IngressContext
Sourcepub fn interactive() -> Self
pub fn interactive() -> Self
Envelope for an interactive operator turn (CLI chat loop, one-shot run).
Sourcepub fn channel() -> Self
pub fn channel() -> Self
Envelope for a turn the channel orchestrator dispatches for a channel peer. Keeps the placeholder source/transport/trust; the real channel transport identity is not stamped at the edge yet.
Sourcepub fn agent_direct() -> Self
pub fn agent_direct() -> Self
Envelope for a direct embedded Agent::turn call.
Sourcepub fn sub_turn() -> Self
pub fn sub_turn() -> Self
Envelope for a nested sub-turn inside a parent turn (delegate subagent, safety net, skills review). Sub-turns never receive origin-gated behavior such as context injection.
Sourcepub fn from_origin(origin: TurnOrigin) -> Self
pub fn from_origin(origin: TurnOrigin) -> Self
Envelope for a turn whose origin is threaded in from the entry
point (e.g. agent::run / process_message, whose one body serves
several distinct entries: CLI, cron, daemon, subagent spawn).
Equivalent to the per-origin constructors above.
Sourcepub fn from_parts(
origin: TurnOrigin,
internal_principal: Option<InternalPrincipal>,
) -> Self
pub fn from_parts( origin: TurnOrigin, internal_principal: Option<InternalPrincipal>, ) -> Self
Envelope for a turn whose origin and (optional) internal principal
are both threaded in from the entry point. With None this is
exactly IngressContext::from_origin.
Sourcepub fn cron_job(job_id: impl Into<String>, job_name: Option<String>) -> Self
pub fn cron_job(job_id: impl Into<String>, job_name: Option<String>) -> Self
Envelope for a scheduled cron job turn stamped with its initiating job. The principal is resolved from the job’s stored config at dispatch and is immutable for the turn’s lifetime.
Sourcepub fn peer_agent(sender_alias: impl Into<String>) -> Self
pub fn peer_agent(sender_alias: impl Into<String>) -> Self
Envelope for a peer-agent dispatch stamped with the sending agent’s canonical alias — the initiator; the recipient turn still executes under the recipient’s own alias.
Sourcepub fn daemon_task(task: impl Into<String>) -> Self
pub fn daemon_task(task: impl Into<String>) -> Self
Envelope for a daemon-driven turn stamped with a runtime-owned task identifier (never model-authored text).
Trait Implementations§
Source§impl Clone for IngressContext
impl Clone for IngressContext
Source§fn clone(&self) -> IngressContext
fn clone(&self) -> IngressContext
1.0.0 (const: unstable) · §fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more