theway_daemon/lib.rs
1//! theway-daemon — the headless agent runtime kernel.
2//!
3//! The daemon composes the core agent runtime with storage, tools, automation,
4//! MCP/LSP adapters, and the gRPC/HTTP/MCP protocol servers. Shared wire
5//! contracts live in `theway-transport`; persistence lives in
6//! `theway-storage`; client presentation lives outside this crate.
7//!
8//! Most implementation modules are crate-private. The root exports process
9//! startup types, while the public modules below are extension surfaces for
10//! custom executors, hooks, storage adapters, tools, and automation sources.
11
12//! Self-alias so `#[path]`-included src modules (integration tests) and lib code
13//! share one absolute path shape: `theway_daemon::tools`, `theway_daemon::...`
14//! resolve identically inside the lib and inside test crates that pull src files
15//! in by path (same pattern as theway-core's `theway_core` alias).
16extern crate self as theway_daemon;
17
18mod agent_session;
19pub mod agent_specs;
20mod bug_report;
21mod builtin_skills;
22mod commands;
23mod context;
24mod control_plane_prompt;
25mod dag_persist;
26pub mod env;
27pub mod executor;
28mod export;
29mod external_protocol_ops;
30mod feed_replay;
31mod file_commands;
32mod forwarding_tool_ops;
33pub mod hook_executors;
34pub mod hooks;
35mod job_transcripts;
36mod local_models;
37mod logging;
38mod lsp;
39mod lsp_supervisor;
40mod mcp_loader;
41mod mcp_server;
42mod model;
43mod observability;
44mod orchestration;
45// Daemon path context (issue #66): one CLI-boundary resolution of every host
46// path (base / home / work dir / extra skill dirs); kernel modules take the
47// resolved values as parameters instead of reading `HOME` / `THEWAY_DIR`.
48mod paths;
49pub use agent_session::{AgentSession, RetrySettings};
50pub use orchestration::{DaemonOptions, DaemonServices, DaemonTransport, SessionSelection, run};
51pub use paths::DaemonPaths;
52pub mod runtime_storage;
53mod turn;
54// Bridged unit tests preserve their original crate-relative auth paths.
55#[cfg(test)]
56pub(crate) use theway_transport::auth;
57#[allow(dead_code)]
58mod session_activation;
59#[allow(dead_code)] // Session assembly consumes this after context construction is introduced.
60mod session_execution;
61mod session_observability;
62pub mod session_ops;
63pub mod skills;
64mod startup_config;
65mod stream_auth;
66
67mod runtime_capabilities;
68mod skill_overrides;
69pub mod templates;
70pub mod tgrep_server;
71pub mod tools;
72mod transport_adapter;
73pub mod trigger_engine;
74pub mod ts_extensions;
75// Server-first: transport is always on (the daemon IS an agent server).
76mod triggers;
77
78// Test-only env serialization lock shared by every bridged unit-test module
79// that mutates process env (commands, local_models, …) — see the file header
80// for the issue #16 race it fixes.
81#[cfg(test)]
82#[path = "../tests/common/env_lock.rs"]
83pub(crate) mod test_env;