返回 CodeWhale
lib.rs
根目录 / crates / engine / src / lib.rs
1 //! Codewhale's engine: the one turn loop, tools, agents, context, the
2 //! session store and thread manager, model clients and the extension host.
3 #![recursion_limit = "512"]
4 #![allow(
5 clippy::too_many_arguments,
6 clippy::uninlined_format_args,
7 rustdoc::private_intra_doc_links
8 )]
9
10 pub mod agent_roster;
11 pub mod approval_log;
12 pub mod auto_reasoning;
13 pub mod automation_manager;
14 pub mod client;
15 pub mod codex_model_cache;
16 pub mod command_catalog;
17 pub mod compaction;
18 pub mod compaction_archive;
19 pub mod conversation_modes;
20 pub mod core;
21 pub mod cost_status;
22 pub mod deepseek_media;
23 pub mod diagnostics_messages;
24 pub mod exec_events;
25 pub mod extension_host;
26 pub mod external_agents;
27 pub mod fleet;
28 pub mod git_status;
29 pub mod hooks;
30 pub mod image_attach;
31 pub mod keybinding_table;
32 pub mod llm_client;
33 pub mod llm_error_envelope;
34 pub mod local_ollama;
35 pub mod mcp;
36 pub mod model_inventory;
37 pub mod model_profile;
38 pub mod model_relevance;
39 pub mod model_routing;
40 pub mod models_dev_live;
41 pub mod operate;
42 pub mod pricing;
43 pub mod profile_constitution;
44 pub mod project_context;
45 pub mod project_context_cache;
46 pub mod prompts;
47 pub mod provider_catalog_live;
48 pub mod provider_lake;
49 pub mod provider_readiness;
50 pub mod purge;
51 pub mod reasoning_preference;
52 pub mod receipts;
53 pub mod repo_law;
54 pub mod request_manifest;
55 pub mod request_tuning;
56 pub mod rlm;
57 pub mod route_billing;
58 pub mod route_budget;
59 pub mod route_preferences;
60 pub mod route_receipt;
61 pub mod route_runtime;
62 pub mod runtime_handoff;
63 pub mod runtime_options;
64 pub mod runtime_threads;
65 pub mod saved_whales;
66 pub mod session_export;
67 pub mod session_image_prune;
68 pub mod session_manager;
69 pub mod session_peek;
70 pub mod session_projection;
71 pub mod session_reconcile;
72 pub mod session_resume;
73 pub mod session_secret_scrub;
74 pub mod superfast;
75 pub mod task_manager;
76 pub mod telemetry_notice;
77 #[cfg(any(test, feature = "test-support"))]
78 pub mod test_support;
79 pub mod todo_snapshot;
80 pub mod tool_inspection;
81 pub mod tools;
82 pub mod turn_route_plan;
83 pub mod usage_persistence;
84 pub mod vision;
85 pub mod voice;
86 pub mod whale_soul;
87 pub mod work_graph;
88 pub mod worker_model_pool;
89
90 pub use codewhale_workflow_js::{
91 ReplyDecodeError, compile_schema as compile_response_schema,
92 decode_reply as decode_schema_reply, repair_prompt as schema_repair_prompt,
93 };
94 pub use jsonschema::Validator as ResponseSchemaValidator;
95
96 /// The platform HTTP client builder the engine's model, search, vision and
97 /// catalog clients start from.
98 ///
99 /// A session builds these clients once and reqwest snapshots the ambient proxy
100 /// environment at build time, so one builder decides the route for the whole
101 /// process lifetime. Installing the loopback fallback here, rather than at
102 /// selected call sites, keeps those clients on the same proxy rules. Reviewed
103 /// plugin remotes, guarded fetches and model clients for registry-admitted
104 /// custom providers do not come through here: they use
105 /// `codewhale_net::guard::guarded_reqwest_client_builder`, which disables
106 /// ambient proxies on purpose.
107 pub(crate) fn platform_client_builder() -> reqwest::ClientBuilder {
108 codewhale_net::proxy::install_loopback_proxy(codewhale_release::tls::reqwest_client_builder())
109 }
110
111 pub fn install_lane_git() {
112 codewhale_lane::set_git_command(codewhale_dependencies::Git::workspace_command);
113 }
114
114 lines RUST