gglib_core/
lib.rs

1#![doc = include_str!(concat!(env!("OUT_DIR"), "/README_GENERATED.md"))]
2#![deny(unused_crate_dependencies)]
3
4pub mod contracts;
5pub mod domain;
6pub mod download;
7pub mod events;
8pub mod paths;
9pub mod ports;
10pub mod services;
11pub mod settings;
12pub mod utils;
13
14// Re-export commonly used types for convenience
15pub use domain::{
16    AGENT_EVENT_CHANNEL_CAPACITY, AgentConfig, AgentConfigError, AgentEvent, AgentMessage,
17    AssistantContent, ChatMessage, Conversation, ConversationUpdate, DEFAULT_MAX_ITERATIONS,
18    DEFAULT_MAX_PARALLEL_TOOLS, LlmStreamEvent, MAX_ITERATIONS_CEILING, MAX_PARALLEL_TOOLS_CEILING,
19    MAX_TOOL_TIMEOUT_MS_CEILING, MIN_CONTEXT_BUDGET_CHARS, MIN_TOOL_TIMEOUT_MS, McpEnvEntry,
20    McpServer, McpServerConfig, McpServerStatus, McpServerType, McpTool, McpToolResult, Message,
21    MessageRole, Model, ModelCapabilities, ModelFilterOptions, NewConversation, NewMcpServer,
22    NewMessage, NewModel, RangeValues, ToolCall, ToolDefinition, ToolResult, UpdateMcpServer,
23    infer_from_chat_template, transform_messages_for_capabilities,
24};
25pub use download::{
26    AttemptCounts, CompletionDetail, CompletionKey, CompletionKind, DownloadError, DownloadEvent,
27    DownloadId, DownloadResult, DownloadStatus, DownloadSummary, FailedDownload, Quantization,
28    QueueRunSummary, QueueSnapshot, QueuedDownload, ShardInfo,
29};
30pub use events::{AppEvent, McpServerSummary, ModelSummary, ServerSnapshotEntry};
31pub use ports::{
32    AgentError, AgentLoopPort, AgentRunOutput, AppEventBridge, AppEventEmitter, ChatHistoryError,
33    ChatHistoryRepository, CompletedDownload, CoreError, DownloadEventEmitterPort,
34    DownloadManagerConfig, DownloadManagerPort, DownloadRequest, DownloadStateRepositoryPort,
35    EmptyToolExecutor, FilteredToolExecutor, GgufCapabilities, GgufMetadata, GgufParseError,
36    GgufParserPort, HfClientPort, HfFileInfo, HfPortError, HfQuantInfo, HfRepoInfo,
37    HfSearchOptions, HfSearchResult, LlmCompletionPort, McpErrorCategory, McpErrorInfo,
38    McpRepositoryError, McpServerRepository, McpServiceError, ModelRegistrarPort, ModelRepository,
39    NoopDownloadEmitter, NoopEmitter, NoopGgufParser, ProcessError, ProcessHandle, ProcessRunner,
40    QuantizationResolver, Repos, RepositoryError, Resolution, ResolvedFile, ServerConfig,
41    ServerHealth, SettingsRepository, TOOL_NOT_AVAILABLE_MSG, ToolExecutorPort,
42};
43pub use services::{ChatHistoryService, ModelRegistrar};
44pub use settings::{
45    DEFAULT_LLAMA_BASE_PORT, DEFAULT_PROXY_PORT, Settings, SettingsError, SettingsUpdate,
46    validate_settings,
47};
48
49// Re-export timing utility
50pub use utils::timing::elapsed_ms;
51
52// Re-export path utilities
53#[cfg(not(target_os = "windows"))]
54pub use paths::DEFAULT_MODELS_DIR_RELATIVE;
55pub use paths::{
56    DirectoryCreationStrategy, ModelsDirResolution, ModelsDirSource, PathError, data_root,
57    database_path, default_models_dir, ensure_directory, env_file_path, is_prebuilt_binary,
58    llama_cli_path, llama_config_path, llama_cpp_dir, llama_server_path, persist_env_value,
59    persist_models_dir, resolve_models_dir, resource_root, verify_writable,
60};
61
62// Silence unused dev-dependency warnings until we add mock-based tests
63#[cfg(test)]
64use mockall as _;
65#[cfg(test)]
66use tokio_test as _;