Repository navigation
Expand file tree
/
Copy pathlib.rs
More file actions
134 lines (120 loc) · 4.88 KB
/
Copy pathlib.rs
File metadata and controls
134 lines (120 loc) · 4.88 KB
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
#![allow(non_snake_case)]
#![recursion_limit = "256"]
//! Compatibility facade and full product runtime assembly.
//!
//! New implementation code should live in owner crates under `src/crates/*`.
//! This crate re-exports legacy paths and wires the full BitFun product runtime.
#[cfg(feature = "agent-runtime")]
pub mod agentic; // Agent system, tool system, and product runtime orchestration
#[cfg(feature = "external-sources")]
pub mod external_hook_import;
#[cfg(feature = "external-sources")]
pub mod external_hooks;
#[cfg(all(test, feature = "external-sources"))]
mod external_hooks_tests;
#[cfg(feature = "external-sources")]
mod external_mcp;
#[cfg(feature = "external-sources")]
pub mod external_mcp_import;
#[cfg(all(test, feature = "external-sources"))]
mod external_mcp_tests;
#[cfg(feature = "external-sources")]
pub mod external_sources;
#[cfg(feature = "external-sources")]
mod external_subagents;
#[cfg(feature = "external-sources")]
mod external_tools;
#[cfg(feature = "function-agents")]
pub mod function_agents; // Function-based agents
pub mod infrastructure; // AI clients, storage, logging, events
#[cfg(feature = "external-sources")]
mod instruction_sources;
#[cfg(feature = "tools-miniapp")]
pub mod miniapp; // AI-generated instant apps (Zero-Dialect Runtime)
#[cfg(feature = "agent-runtime")]
pub mod native_hooks;
#[cfg(all(test, feature = "agent-runtime"))]
mod native_hooks_tests;
#[cfg(feature = "plugin-runtime")]
pub mod plugin_runtime;
#[cfg(feature = "plugin-source")]
pub mod plugin_source;
#[cfg(feature = "agent-runtime")]
pub mod product_assembly;
#[cfg(all(test, feature = "product-full"))]
mod product_assembly_tests;
#[cfg(any(feature = "function-agents", feature = "tools-miniapp"))]
pub(crate) mod product_domain_runtime;
#[cfg(feature = "agent-runtime")]
pub mod product_runtime;
#[cfg(feature = "agent-runtime")]
pub mod runtime_ownership;
#[cfg(all(test, feature = "agent-runtime"))]
mod runtime_ownership_tests;
pub mod service; // Workspace, Config, FileSystem, Terminal, Git
#[cfg(feature = "agent-runtime")]
pub(crate) mod service_agent_runtime;
pub mod util; // General types, errors, helper functions
// Re-export debug_log from infrastructure for backward compatibility.
#[cfg(feature = "debug-log")]
pub use infrastructure::debug_log as debug;
#[cfg(feature = "remote-connect")]
pub use bitfun_services_integrations::remote_connect::RemoteModelCatalog as AIModelCatalog;
#[cfg(feature = "agent-runtime")]
pub fn get_builtin_ai_provider_catalog() -> bitfun_core_types::ProviderCatalog {
infrastructure::ai::provider_catalog::resolve_builtin_provider_catalog(
None,
"bitfun-builtin".to_string(),
bitfun_core_types::ProviderCatalogSource::Bitfun,
)
}
#[cfg(feature = "remote-connect")]
pub async fn get_ai_model_catalog() -> Result<AIModelCatalog, String> {
service_agent_runtime::CoreServiceAgentRuntime::load_remote_model_catalog(None).await
}
#[cfg(feature = "model-catalog")]
pub async fn project_ai_model_reasoning_catalog(
request: bitfun_core_types::ReasoningCatalogProjectionRequest,
) -> bitfun_core_types::ReasoningCatalogProjection {
infrastructure::ai::reasoning_catalog::project_reasoning_catalog_request(request).await
}
#[cfg(feature = "model-catalog")]
pub async fn get_models_dev_catalog_status() -> bitfun_core_types::ModelsDevCatalogStatus {
infrastructure::ai::reasoning_catalog::get_models_dev_catalog_status().await
}
#[cfg(feature = "model-catalog")]
pub async fn refresh_models_dev_catalog_now(
) -> Result<bitfun_core_types::ModelsDevRefreshResult, String> {
infrastructure::ai::reasoning_catalog::refresh_models_dev_catalog_now().await
}
// Export main types
pub use bitfun_runtime_ports as runtime_ports;
pub use util::errors::*;
pub use util::types::*;
// Export service layer components
pub use service::config::{ConfigManager, ConfigService};
#[cfg(feature = "workspace-runtime")]
pub use service::workspace::{WorkspaceManager, WorkspaceProvider, WorkspaceService};
// Export infrastructure components
#[cfg(feature = "ai-adapter-runtime")]
pub use infrastructure::ai::AIClient;
#[cfg(feature = "runtime-services")]
pub use infrastructure::events::BackendEventManager;
// Export Agentic service core types
#[cfg(feature = "agent-runtime")]
pub use agentic::{
core::{Message, Session},
// NOTE: agentic::core::DialogTurn / ModelRound used to be re-exported here
// but were dead code (never persisted, never read). On-disk shape lives in
// service::session::{DialogTurnData, ModelRoundData}; lifecycle state is
// tracked through SessionState + TurnStatus.
events::{AgenticEvent, EventQueue, EventRouter},
execution::{ExecutionEngine, StreamProcessor},
tools::{Tool, ToolPipeline},
};
// Export ToolRegistry separately.
#[cfg(feature = "agent-runtime")]
pub use agentic::tools::registry::ToolRegistry;
// Version information
pub const VERSION: &str = env!("CARGO_PKG_VERSION");
pub const CORE_NAME: &str = "BitFun Core";