1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
//! Public in-process runtime for embedding Everruns.
//!
//! The runtime crate exposes an in-memory execution surface that runs the same
//! core atoms (`input`, `reason`, `act`) used elsewhere in the system, but
//! without the durable engine, gRPC worker boundary, or control-plane server.
//! It is part of the [Everruns](https://everruns.com) ecosystem.
//!
//! This is the intended public entrypoint for embedders who want to:
//!
//! - run sessions in their own process
//! - provide their own platform definition (capabilities, drivers, harnesses)
//! - seed harnesses, agents, sessions, and workspace files directly in code
//! - replace the default in-memory stores with custom runtime backends
//! - inspect the assembled turn context before or after executing a turn
//! - reuse runtime-owned host phase execution from durable or server-backed hosts
//! - map `plan_next_host_turn(...)` onto their own queue, retry, or in-memory host
//!
//! `InProcessRuntimeBuilder::new()` starts from a runtime-safe built-in
//! capability registry. Hosted Everruns product capabilities and capabilities
//! that require optional host backends can still be enabled by supplying an
//! explicit [`PlatformDefinition`](everruns_core::PlatformDefinition).
//!
//! For a runnable example, see:
//!
//! ```text
//! cargo run -p everruns-runtime --example in_process_runtime
//! cargo run -p everruns-runtime --example inspect_context
//! ```
//!
//! # Example
//!
//! ```
//! # #[tokio::main]
//! # async fn main() -> Result<(), everruns_core::AgentLoopError> {
//! use everruns_core::{
//! CapabilityRegistry, DriverRegistry, InputMessage, DriverId, ResolvedModel,
//! PlatformDefinition,
//! };
//! use everruns_core::capabilities::TestMathCapability;
//! use everruns_runtime::InProcessRuntimeBuilder;
//!
//! let mut capabilities = CapabilityRegistry::new();
//! capabilities.register(TestMathCapability);
//!
//! let platform = PlatformDefinition::new(capabilities, DriverRegistry::new());
//!
//! let runtime = InProcessRuntimeBuilder::new()
//! .platform_definition(platform)
//! .single_session(|s| {
//! s.harness("math", "You are a calculator.")
//! .harness_display_name("Math")
//! .with_capability("test_math")
//! .agent("math-agent", "Use tools when needed.")
//! .agent_display_name("Math Agent")
//! .agent_max_iterations(8)
//! .session_title("Math Session")
//! })
//! .llm_sim(everruns_core::llmsim_driver::LlmSimConfig::fixed("4"))
//! .default_model(ResolvedModel {
//! model: "llmsim-model".into(),
//! provider_type: DriverId::LlmSim,
//! api_key: Some("fake-key".into()),
//! base_url: None,
//! provider_metadata: None,
//! })
//! .build()
//! .await?;
//!
//! let session_id = runtime.default_session_id().expect("single_session id");
//! let result = runtime
//! .run_turn(
//! session_id,
//! InputMessage::user("What is 2 + 2?"),
//! )
//! .await?;
//! assert!(result.success);
//! # Ok(())
//! # }
//! ```
//!
//! # Real-disk workspace
//!
//! Embedders who want built-in capabilities (`file_system`,
//! `agent_instructions`, `skills`, ...) to read and write a real directory
//! on disk can configure [`RealDiskSessionFileSystemFactory`] on their
//! [`PlatformDefinition`](everruns_core::PlatformDefinition). Every capability that goes through
//! `ToolContext.file_store` or `SystemPromptContext.file_store` picks it up
//! automatically.
//!
//! See the runnable examples for the full wiring:
//!
//! ```text
//! cargo run -p everruns-runtime --example real_disk_agent_instructions
//! cargo run -p everruns-runtime --example real_disk_file_system_tools
//! ```
//!
//! And `specs/file-store.md` for the trait contract.
pub use ;
pub use ;
pub use AssembledTurnContext;
// Embeddable in-process task-transition observation (EVE-729): embedders
// implement `TaskTransitionObserver` to receive task lifecycle transitions
// (terminal / awaiting_input / outbound message) in process, with the same
// filter semantics as server webhook delivery but without HTTP.
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;