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, DEFAULT_MAX_STAGNATION_STEPS, LlmStreamEvent,
19    MAX_ITERATIONS_CEILING, MAX_PARALLEL_TOOLS_CEILING, MAX_TOOL_TIMEOUT_MS_CEILING,
20    MIN_CONTEXT_BUDGET_CHARS, MIN_TOOL_TIMEOUT_MS, McpEnvEntry, McpServer, McpServerConfig,
21    McpServerStatus, McpServerType, McpTool, McpToolResult, Message, MessageRole, Model,
22    ModelCapabilities, ModelFilterOptions, NewConversation, NewMcpServer, NewMessage, NewModel,
23    RangeValues, ToolCall, ToolDefinition, ToolResult, UpdateMcpServer, infer_from_chat_template,
24    transform_messages_for_capabilities,
25};
26pub use download::{
27    AttemptCounts, CompletionDetail, CompletionKey, CompletionKind, DownloadError, DownloadEvent,
28    DownloadId, DownloadResult, DownloadStatus, DownloadSummary, FailedDownload, Quantization,
29    QueueRunSummary, QueueSnapshot, QueuedDownload, ShardInfo,
30};
31pub use events::{AppEvent, McpServerSummary, ModelSummary, ServerSnapshotEntry};
32pub use ports::{
33    AgentError, AgentLoopPort, AgentRunOutput, AppEventBridge, AppEventEmitter, ChatHistoryError,
34    ChatHistoryRepository, CompletedDownload, CoreError, DownloadEventEmitterPort,
35    DownloadManagerConfig, DownloadManagerPort, DownloadRequest, DownloadStateRepositoryPort,
36    EmptyToolExecutor, FilteredToolExecutor, GgufCapabilities, GgufMetadata, GgufParseError,
37    GgufParserPort, HfClientPort, HfFileInfo, HfPortError, HfQuantInfo, HfRepoInfo,
38    HfSearchOptions, HfSearchResult, LlmCompletionPort, McpErrorCategory, McpErrorInfo,
39    McpRepositoryError, McpServerRepository, McpServiceError, ModelRegistrarPort, ModelRepository,
40    NoopDownloadEmitter, NoopEmitter, NoopGgufParser, ProcessError, ProcessHandle, ProcessRunner,
41    QuantizationResolver, Repos, RepositoryError, Resolution, ResolvedFile, ServerConfig,
42    ServerHealth, SettingsRepository, TOOL_NOT_AVAILABLE_MSG, ToolExecutorPort,
43};
44pub use services::{ChatHistoryService, ModelRegistrar};
45pub use settings::{
46    DEFAULT_CONTEXT_SIZE, DEFAULT_LLAMA_BASE_PORT, DEFAULT_PROXY_PORT, Settings, SettingsError,
47    SettingsUpdate, validate_settings,
48};
49
50// Re-export timing utility
51pub use utils::timing::{elapsed_ms, format_duration_human};
52
53// Re-export path utilities
54#[cfg(not(target_os = "windows"))]
55pub use paths::DEFAULT_MODELS_DIR_RELATIVE;
56pub use paths::{
57    DirectoryCreationStrategy, ModelsDirResolution, ModelsDirSource, PathError, data_root,
58    database_path, default_models_dir, ensure_directory, env_file_path, is_prebuilt_binary,
59    llama_config_path, llama_cpp_dir, llama_server_path, persist_env_value, persist_models_dir,
60    resolve_models_dir, resource_root, verify_writable,
61};
62
63// Silence unused dev-dependency warnings until we add mock-based tests
64#[cfg(test)]
65use mockall as _;
66#[cfg(test)]
67use tokio_test as _;