pub struct RuntimeSessionLifecycle<A: RuntimeHostAdapter> { /* private fields */ }Implementations§
Source§impl<A: RuntimeHostAdapter> RuntimeSessionLifecycle<A>
impl<A: RuntimeHostAdapter> RuntimeSessionLifecycle<A>
pub fn new(adapter: A, org_id: i64, session_id: SessionId) -> Self
pub async fn turn_started( &self, turn_id: TurnId, input_message_id: MessageId, ) -> Result<()>
pub async fn emit_turn_completed( &self, input_message_id: MessageId, data: TurnCompletedData, ) -> Result<()>
pub async fn emit_session_idled( &self, turn_id: TurnId, input_message_id: MessageId, iterations: Option<u32>, usage: Option<TokenUsage>, ) -> Result<()>
pub async fn turn_completed( &self, turn_id: TurnId, input_message_id: MessageId, iterations: u32, usage: Option<TokenUsage>, input_content: Option<String>, ) -> Result<()>
Sourcepub async fn turn_sealed(
&self,
turn_id: TurnId,
input_message_id: MessageId,
reason: &str,
iterations: u32,
usage: Option<TokenUsage>,
) -> Result<()>
pub async fn turn_sealed( &self, turn_id: TurnId, input_message_id: MessageId, reason: &str, iterations: u32, usage: Option<TokenUsage>, ) -> Result<()>
Turn was deliberately sealed (EVE-534): emit turn.sealed + a
user-facing message + session.idled, and idle the session.
Distinct from turn_completed (success) and turn_failed (error). The
session returns to idle so the UI unblocks; the Sealed state is
observable via the turn.sealed event and its reason.
Sourcepub async fn fire_turn_end_hooks(
&self,
harness_id: HarnessId,
agent_id: Option<AgentId>,
turn_id: TurnId,
success: bool,
)
pub async fn fire_turn_end_hooks( &self, harness_id: HarnessId, agent_id: Option<AgentId>, turn_id: TurnId, success: bool, )
Fire turn_end lifecycle hooks (advisory). Collects the session’s hook
specs and runs every turn_end hook; failures are logged, never fatal.
harness_id/agent_id are required to resolve the capability chain.
Sourcepub async fn user_prompt_blocked(
&self,
turn_id: TurnId,
input_message_id: MessageId,
reason: &str,
user_message: Option<&str>,
) -> Result<()>
pub async fn user_prompt_blocked( &self, turn_id: TurnId, input_message_id: MessageId, reason: &str, user_message: Option<&str>, ) -> Result<()>
Abort a turn because a user_prompt_submit hook returned Block.
Reuses the dependency-blocked failure shape: emit a user-facing message
carrying the hook’s user_message (or reason), then mark the turn
failed and idle the session.
pub async fn turn_failed( &self, turn_id: TurnId, input_message_id: MessageId, error: &str, user_error: Option<&UserFacingError>, ) -> Result<()>
Sourcepub async fn turn_failed_with_disclosure(
&self,
turn_id: TurnId,
input_message_id: MessageId,
error: &str,
user_error: Option<&UserFacingError>,
disclosure: Option<ErrorDisclosure>,
) -> Result<()>
pub async fn turn_failed_with_disclosure( &self, turn_id: TurnId, input_message_id: MessageId, error: &str, user_error: Option<&UserFacingError>, disclosure: Option<ErrorDisclosure>, ) -> Result<()>
turn_failed with the applied error-disclosure mode recorded on the
event. user_error (and the error text shown alongside it) must
already be disclosure-filtered by the caller.