merry-runtime 0.1.4

Structured session, task ledger, context compaction, memory, permission, and tool runtime for Merry.
Documentation
//! Runtime-owned serial agent loop.
//!
//! The public module is intentionally a narrow facade over focused loop
//! components. Configuration, protocol handles, execution drivers, producer
//! lifecycle, and tool-wave classification live in separate modules so each
//! owns one part of the runtime contract.

mod config;
mod driver;
mod helpers;
mod hook_step;
mod producer;
mod run;
mod tool_flow;
mod types;

pub use config::{
    AgentLoopConfig, AgentLoopConfigError, DEFAULT_AGENT_LOOP_MAX_MODEL_TURNS,
    StructuredOutputRetryPolicy,
};
pub use run::{AgentRun, AgentRunMessage};
pub use types::{AgentLoopBlockedReason, AgentLoopError, AgentLoopResult, AgentLoopStatus};

pub(crate) use helpers::{
    FinalOutputStepDecision, agent_loop_cancelled_diagnostic, agent_loop_stream_error,
    agent_loop_stream_error_with_source, blocked_reason_code, build_step_context,
    can_retry_structured_output, collect_step_events, continuation_step_input,
    evaluate_and_record_final_output_call, final_assistant_output_from_step,
    finish_agent_loop_result, max_model_turns_blocked_result,
    preempt_next_input_with_subagent_notification, publish_journal_event,
    structured_output_failure_result, take_subagent_notification, take_subagent_notification_input,
    tool_execution_cancelled_diagnostic, tool_resolution_diagnostic_code,
    tool_resolution_is_policy_denied, tool_resolution_status, trace_loop_error, trace_loop_finish,
};
pub(crate) use hook_step::{
    AfterStepHookAction, BeforeStepHookAction, StepHookContext, run_after_model_step_hook,
    run_before_model_step_hook,
};
pub(crate) use tool_flow::{
    PendingLoopToolCall, PendingLoopToolWave, StepOutcome, classify_step_events,
    execute_stream_runtime_batch, next_agent_run_batch_id, partition_tool_waves,
    receive_and_publish_bridge_tool_results,
};